X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FfindDeprecated.php;h=94b7fb4429222c1808506e1abc8c14a3542dec55;hb=fb79f30319b9ad2a7eb0f5f4d1668143ec8f963e;hp=bc1b34aa67f9b988b82558d65a9504f1c5fda377;hpb=e5facc46bc170c302438f60849041b0d6be75e82;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/findDeprecated.php b/maintenance/findDeprecated.php index bc1b34aa67..94b7fb4429 100644 --- a/maintenance/findDeprecated.php +++ b/maintenance/findDeprecated.php @@ -71,6 +71,9 @@ class DeprecatedInterfaceFinder extends FileAwareNodeVisitor { * indicating that it is a hard-deprecated interface. */ 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 +145,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 );