X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FfindDeprecated.php;h=d4f9c2d0c7835da517f1a88f7dba1a50b83a4361;hb=bb1d8568d78a905c24f63596e37d9362dc0c7327;hp=6128d2386deacc376005eb46ac5f12df82e9df0b;hpb=1b13888ed6bd09731f10045650714a3392bb55df;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;