Update nikic/php-parser to 3.1.3
authorKunal Mehta <legoktm@member.fsf.org>
Thu, 4 Jan 2018 08:18:30 +0000 (00:18 -0800)
committerReedy <reedy@wikimedia.org>
Fri, 5 Jan 2018 01:32:52 +0000 (01:32 +0000)
And fix the only incompatibility in findDeprecated.php. It's OK to throw
exceptions on invalid files since we lint all PHP files so there
should be no invalid ones.

Change-Id: Ie5913c2aae4b521a4b6f805e911e4e2764386b45

RELEASE-NOTES-1.31
composer.json
maintenance/findDeprecated.php

index d18c5cf..30a174a 100644 (file)
@@ -44,6 +44,8 @@ production.
 * Updated jquery.chosen from v0.9.14 to v1.8.2.
 * Updated composer/spdx-licenses from 1.1.4 to
   1.2.0 (development dependency).
+* Updated nikic/php-parser from 2.1.0 to 3.1.3
+  (development dependency).
 * …
 
 ==== New external libraries ====
index 6b3e8f7..d92ffc9 100644 (file)
@@ -56,7 +56,7 @@
                "justinrainbow/json-schema": "~5.2",
                "mediawiki/mediawiki-codesniffer": "15.0.0",
                "monolog/monolog": "~1.22.1",
-               "nikic/php-parser": "2.1.0",
+               "nikic/php-parser": "3.1.3",
                "nmred/kafka-php": "0.1.5",
                "phpunit/phpunit": "4.8.36",
                "psy/psysh": "0.8.11",
index 6128d23..ec998da 100644 (file)
@@ -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 ) {