X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FfindDeprecated.php;h=6128d2386deacc376005eb46ac5f12df82e9df0b;hb=763de4b3205f4e1fb81041859e76c6228ff0229f;hp=bc1b34aa67f9b988b82558d65a9504f1c5fda377;hpb=8eac2feedb7ee093d2c48504e1eb2b8a9dbc8452;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/findDeprecated.php b/maintenance/findDeprecated.php index bc1b34aa67..6128d2386d 100644 --- a/maintenance/findDeprecated.php +++ b/maintenance/findDeprecated.php @@ -69,8 +69,13 @@ class DeprecatedInterfaceFinder extends FileAwareNodeVisitor { /** * Check whether a function or method includes a call to wfDeprecated(), * indicating that it is a hard-deprecated interface. + * @param PhpParser\Node $node + * @return bool */ public function isHardDeprecated( PhpParser\Node $node ) { + if ( !$node->stmts ) { + return false; + } foreach ( $node->stmts as $stmt ) { if ( $stmt instanceof PhpParser\Node\Expr\FuncCall @@ -142,7 +147,7 @@ class FindDeprecated extends Maintenance { $files = $this->getFiles(); $chunkSize = ceil( count( $files ) / 72 ); - $parser = new PhpParser\Parser( new PhpParser\Lexer\Emulative ); + $parser = ( new PhpParser\ParserFactory )->create( PhpParser\ParserFactory::PREFER_PHP7 ); $traverser = new PhpParser\NodeTraverser; $finder = new DeprecatedInterfaceFinder; $traverser->addVisitor( $finder );