Use @phpcs-require-sorted-array for ServiceWiring.php

The PHPCS sniff is even autofixable, which is convenient. (And it uses
the same sorting function as our previous test, natcasesort().)

Change-Id: Id4736d8feed853c0acefd65d01673cce9ffa78af
This commit is contained in:
Lucas Werkmeister 2021-02-25 13:01:58 +01:00 committed by DannyS712
parent 5b7fe6ff7c
commit a6c860de82
2 changed files with 1 additions and 16 deletions

View file

@ -139,6 +139,7 @@ use Wikimedia\RequestTimeout\RequestTimeout;
use Wikimedia\Services\RecursiveServiceDependencyException;
use Wikimedia\UUID\GlobalIdGenerator;
/** @phpcs-require-sorted-array */
return [
'ActorMigration' => static function ( MediaWikiServices $services ) : ActorMigration {
return new ActorMigration(

View file

@ -1,16 +0,0 @@
<?php
/**
* @coversNothing
*/
class ServiceWiringTest extends \MediaWikiUnitTestCase {
public function testServicesAreSorted() {
global $IP;
$services = array_keys( require "$IP/includes/ServiceWiring.php" );
$sortedServices = $services;
natcasesort( $sortedServices );
$this->assertSame( $sortedServices, $services,
'Please keep services sorted alphabetically' );
}
}