X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FfindDeprecated.php;h=94b7fb4429222c1808506e1abc8c14a3542dec55;hb=dceb5a9836ffe5a3840dfa2e54069c28936acc97;hp=bc1b34aa67f9b988b82558d65a9504f1c5fda377;hpb=734ca2b4d2a1246fb0ea1e54b861ab423ab5e257;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 );