summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2019-02-14 21:23:42 +0100
committerGitHub <noreply@github.com>2019-02-14 21:23:42 +0100
commitea3fa78a854cd73f93950fa1a6643abbd81de429 (patch)
treed42f1faa8692095947c072e03cdb748fb51b71c7
parentfc39b2854983c912fb483f1d0d9c214fbf023108 (diff)
parent843066b708c550f610073330c6e75093351e8667 (diff)
downloadnextcloud-server-ea3fa78a854cd73f93950fa1a6643abbd81de429.tar.gz
nextcloud-server-ea3fa78a854cd73f93950fa1a6643abbd81de429.zip
Merge pull request #14167 from nextcloud/techdebt/noid/update-php-parser-for-7.1-compat
Update PHP-Parser for 7.1 compatibility
m---------3rdparty0
-rw-r--r--build/OCPSinceChecker.php2
-rw-r--r--lib/private/App/CodeChecker/CodeChecker.php4
-rw-r--r--tests/lib/Command/AsyncBusTest.php4
4 files changed, 5 insertions, 5 deletions
diff --git a/3rdparty b/3rdparty
-Subproject 2fac6fcf993f9cff25845218c3dccf3617ae14a
+Subproject 42b675142d5c33b585f1bb204e910afeed7e98d
diff --git a/build/OCPSinceChecker.php b/build/OCPSinceChecker.php
index 04a19b3416f..13f58fe2550 100644
--- a/build/OCPSinceChecker.php
+++ b/build/OCPSinceChecker.php
@@ -99,7 +99,7 @@ class SinceTagCheckVisitor extends \PhpParser\NodeVisitorAbstract {
echo 'Parsing all files in lib/public for the presence of @since or @deprecated on each method...' . PHP_EOL . PHP_EOL;
-$parser = new PhpParser\Parser(new PhpParser\Lexer);
+$parser = (new PhpParser\ParserFactory)->create(PhpParser\ParserFactory::PREFER_PHP7);
/* iterate over all .php files in lib/public */
$Directory = new RecursiveDirectoryIterator(dirname(__DIR__) . '/lib/public');
diff --git a/lib/private/App/CodeChecker/CodeChecker.php b/lib/private/App/CodeChecker/CodeChecker.php
index d2f6d7451b4..8f539897c97 100644
--- a/lib/private/App/CodeChecker/CodeChecker.php
+++ b/lib/private/App/CodeChecker/CodeChecker.php
@@ -25,9 +25,9 @@
namespace OC\App\CodeChecker;
use OC\Hooks\BasicEmitter;
-use PhpParser\Lexer;
use PhpParser\NodeTraverser;
use PhpParser\Parser;
+use PhpParser\ParserFactory;
use RecursiveCallbackFilterIterator;
use RecursiveDirectoryIterator;
use RecursiveIteratorIterator;
@@ -57,7 +57,7 @@ class CodeChecker extends BasicEmitter {
public function __construct(ICheck $checkList, $checkMigrationSchema) {
$this->checkList = $checkList;
$this->checkMigrationSchema = $checkMigrationSchema;
- $this->parser = new Parser(new Lexer);
+ $this->parser = (new ParserFactory)->create(ParserFactory::PREFER_PHP7);
}
/**
diff --git a/tests/lib/Command/AsyncBusTest.php b/tests/lib/Command/AsyncBusTest.php
index da168d66e6d..8f07738bec6 100644
--- a/tests/lib/Command/AsyncBusTest.php
+++ b/tests/lib/Command/AsyncBusTest.php
@@ -136,7 +136,7 @@ abstract class AsyncBusTest extends TestCase {
public function testClosureSelf() {
$this->getBus()->push(function () {
- self::$lastCommand = 'closure-self';
+ AsyncBusTest::$lastCommand = 'closure-self';
});
$this->runJobs();
$this->assertEquals('closure-self', self::$lastCommand);
@@ -154,7 +154,7 @@ abstract class AsyncBusTest extends TestCase {
public function testClosureBind() {
$state = 'bar';
$this->getBus()->push(function () use ($state) {
- self::$lastCommand = 'closure-' . $state;
+ AsyncBusTest::$lastCommand = 'closure-' . $state;
});
$this->runJobs();
$this->assertEquals('closure-bar', self::$lastCommand);