EditPage: Rename and make getSubmitButtonLabel() protected
[lhc/web/wiklou.git] / maintenance / findDeprecated.php
index bc1b34a..6128d23 100644 (file)
@@ -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 );