X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=maintenance%2FfindDeprecated.php;h=d4f9c2d0c7835da517f1a88f7dba1a50b83a4361;hb=9f381111d512c030bb9149b9502abfb9607a383e;hp=6128d2386deacc376005eb46ac5f12df82e9df0b;hpb=732b5e2745ca8f6153e19cc10c3c9acb1b2a6331;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/findDeprecated.php b/maintenance/findDeprecated.php index 6128d2386d..d4f9c2d0c7 100644 --- a/maintenance/findDeprecated.php +++ b/maintenance/findDeprecated.php @@ -59,7 +59,7 @@ class DeprecatedInterfaceFinder extends FileAwareNodeVisitor { // Sort results by version, then by filename, then by name. foreach ( $this->foundNodes as $version => &$nodes ) { uasort( $nodes, function ( $a, $b ) { - return ( $a['filename'] . $a['name'] ) < ( $b['filename'] . $b['name'] ) ? -1 : 1; + return ( $a['filename'] . $a['name'] ) <=> ( $b['filename'] . $b['name'] ); } ); } ksort( $this->foundNodes ); @@ -132,6 +132,9 @@ class FindDeprecated extends Maintenance { $this->addDescription( 'Find deprecated interfaces' ); } + /** + * @return SplFileInfo[] + */ public function getFiles() { global $IP; @@ -163,7 +166,7 @@ class FindDeprecated extends Maintenance { } $finder->setCurrentFile( substr( $file->getPathname(), strlen( $IP ) + 1 ) ); - $nodes = $parser->parse( $code, [ 'throwOnError' => false ] ); + $nodes = $parser->parse( $code ); $traverser->traverse( $nodes ); if ( $i % $chunkSize === 0 ) { @@ -199,5 +202,5 @@ class FindDeprecated extends Maintenance { } } -$maintClass = 'FindDeprecated'; +$maintClass = FindDeprecated::class; require_once RUN_MAINTENANCE_IF_MAIN;