[TASK] Update composer-dep nikic/php-parser to 4.0.1 28/56128/8
authorStefan Neufeind <typo3.neufeind@speedpartner.de>
Mon, 19 Mar 2018 20:10:34 +0000 (21:10 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Thu, 10 May 2018 14:47:44 +0000 (16:47 +0200)
Command used:
composer require nikic/php-parser ^4.0

Resolves: #84237
Releases: master
Change-Id: I7eed5bbc31f2be6084356d86b35231d93bc6ecb2
Reviewed-on: https://review.typo3.org/56128
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
17 files changed:
composer.json
composer.lock
typo3/sysext/core/composer.json
typo3/sysext/install/Classes/ExtensionScanner/Php/GeneratorClassesResolver.php
typo3/sysext/install/Classes/ExtensionScanner/Php/Matcher/InterfaceMethodChangedMatcher.php
typo3/sysext/install/Classes/ExtensionScanner/Php/Matcher/MethodArgumentDroppedMatcher.php
typo3/sysext/install/Classes/ExtensionScanner/Php/Matcher/MethodArgumentDroppedStaticMatcher.php
typo3/sysext/install/Classes/ExtensionScanner/Php/Matcher/MethodArgumentRequiredMatcher.php
typo3/sysext/install/Classes/ExtensionScanner/Php/Matcher/MethodArgumentRequiredStaticMatcher.php
typo3/sysext/install/Classes/ExtensionScanner/Php/Matcher/MethodArgumentUnusedMatcher.php
typo3/sysext/install/Classes/ExtensionScanner/Php/Matcher/MethodCallMatcher.php
typo3/sysext/install/Classes/ExtensionScanner/Php/Matcher/MethodCallStaticMatcher.php
typo3/sysext/install/Classes/ExtensionScanner/Php/Matcher/PropertyExistsStaticMatcher.php
typo3/sysext/install/Classes/ExtensionScanner/Php/Matcher/PropertyProtectedMatcher.php
typo3/sysext/install/Classes/ExtensionScanner/Php/Matcher/PropertyPublicMatcher.php
typo3/sysext/install/Tests/Unit/ExtensionScanner/Php/GeneratorClassesResolverTest.php
typo3/sysext/install/composer.json

index 0ece019..8300b47 100644 (file)
@@ -42,7 +42,7 @@
                "doctrine/instantiator": "~1.0.4",
                "guzzlehttp/guzzle": "^6.3.0",
                "mso/idna-convert": "^1.1.0",
-               "nikic/php-parser": "^3.1",
+               "nikic/php-parser": "^4.0",
                "psr/container": "^1.0",
                "psr/http-message": "~1.0",
                "psr/http-server-middleware": "^1.0",
index 63df5e8..5be3989 100644 (file)
@@ -4,7 +4,7 @@
         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
         "This file is @generated automatically"
     ],
-    "content-hash": "d5997be140aa762b2cb664fccaba94fe",
+    "content-hash": "ed7b3b2d40814c9c50fbd22ec9c5e085",
     "packages": [
         {
             "name": "cogpowered/finediff",
         },
         {
             "name": "nikic/php-parser",
-            "version": "v3.1.1",
+            "version": "v4.0.1",
             "source": {
                 "type": "git",
                 "url": "https://github.com/nikic/PHP-Parser.git",
-                "reference": "a1e8e1a30e1352f118feff1a8481066ddc2f234a"
+                "reference": "e4a54fa90a5cd8e8dd3fb4099942681731c5cdd3"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/a1e8e1a30e1352f118feff1a8481066ddc2f234a",
-                "reference": "a1e8e1a30e1352f118feff1a8481066ddc2f234a",
+                "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/e4a54fa90a5cd8e8dd3fb4099942681731c5cdd3",
+                "reference": "e4a54fa90a5cd8e8dd3fb4099942681731c5cdd3",
                 "shasum": ""
             },
             "require": {
                 "ext-tokenizer": "*",
-                "php": ">=5.5"
+                "php": ">=7.0"
             },
             "require-dev": {
-                "phpunit/phpunit": "~4.0|~5.0"
+                "phpunit/phpunit": "^6.5 || ^7.0"
             },
             "bin": [
                 "bin/php-parse"
             "type": "library",
             "extra": {
                 "branch-alias": {
-                    "dev-master": "3.0-dev"
+                    "dev-master": "4.0-dev"
                 }
             },
             "autoload": {
                 "parser",
                 "php"
             ],
-            "time": "2017-09-02T17:10:46+00:00"
+            "time": "2018-03-25T17:35:16+00:00"
         },
         {
             "name": "psr/container",
index d2d5564..a9f581d 100644 (file)
@@ -24,7 +24,7 @@
                "doctrine/instantiator": "~1.0.4",
                "guzzlehttp/guzzle": "^6.3.0",
                "mso/idna-convert": "^1.1.0",
-               "nikic/php-parser": "^3.1",
+               "nikic/php-parser": "^4.0",
                "psr/container": "^1.0",
                "psr/http-message": "~1.0",
                "psr/http-server-middleware": "^1.0",
index 74c28bd..f4aa163 100644 (file)
@@ -42,7 +42,7 @@ class GeneratorClassesResolver extends NodeVisitorAbstract
         if ($node instanceof StaticCall
             && $node->class instanceof FullyQualified
             && $node->class->toString() === 'TYPO3\CMS\Core\Utility\GeneralUtility'
-            && $node->name === 'makeInstance'
+            && $node->name->name === 'makeInstance'
             && isset($node->args[0]->value)
             && $node->args[0]->value instanceof String_
         ) {
index bdb29f3..1be9f71 100644 (file)
@@ -58,11 +58,11 @@ class InterfaceMethodChangedMatcher extends AbstractCoreMatcher
 
         // Match method name of a class, must be public, wouldn't make sense as interface if protected/private
         if ($node instanceof ClassMethod
-            && in_array($node->name, array_keys($this->matcherDefinitions), true)
+            && in_array($node->name->name, array_keys($this->matcherDefinitions), true)
             && $node->flags & Class_::MODIFIER_PUBLIC // public
             && ($node->flags & Class_::MODIFIER_STATIC) !== Class_::MODIFIER_STATIC // not static
         ) {
-            $methodName = $node->name;
+            $methodName = $node->name->name;
             $numberOfUsedArguments = 0;
             if (isset($node->params) && is_array($node->params)) {
                 $numberOfUsedArguments = count($node->params);
@@ -80,9 +80,9 @@ class InterfaceMethodChangedMatcher extends AbstractCoreMatcher
 
         // Match method call (not static) with number of arguments
         if ($node instanceof MethodCall
-            && in_array($node->name, array_keys($this->matcherDefinitions), true)
+            && in_array($node->name->name, array_keys($this->matcherDefinitions), true)
         ) {
-            $methodName = $node->name;
+            $methodName = $node->name->name;
             $numberOfUsedArguments = 0;
             if (isset($node->args) && is_array($node->args)) {
                 $numberOfUsedArguments = count($node->args);
index 0f9adb3..82c9d24 100644 (file)
@@ -50,7 +50,7 @@ class MethodArgumentDroppedMatcher extends AbstractCoreMatcher
         if (!$this->isFileIgnored($node)
             && !$this->isLineIgnored($node)
             && $node instanceof MethodCall
-            && in_array($node->name, array_keys($this->flatMatcherDefinitions), true)
+            && in_array($node->name->name, array_keys($this->flatMatcherDefinitions), true)
         ) {
             $match = [
                 'restFiles' => [],
@@ -62,14 +62,14 @@ class MethodArgumentDroppedMatcher extends AbstractCoreMatcher
 
             $numberOfArguments = count($node->args);
             $isPossibleMatch = false;
-            foreach ($this->flatMatcherDefinitions[$node->name]['candidates'] as $candidate) {
+            foreach ($this->flatMatcherDefinitions[$node->name->name]['candidates'] as $candidate) {
                 // A method call is considered a match if it is not called with argument unpacking
                 // and number of used arguments is higher than maximumNumberOfArguments
                 if (!$isArgumentUnpackingUsed
                     && $numberOfArguments > $candidate['maximumNumberOfArguments']
                 ) {
                     $isPossibleMatch = true;
-                    $match['message'] = 'Method "' . $node->name . '()" supports only ' . $candidate['maximumNumberOfArguments'] . ' arguments.';
+                    $match['message'] = 'Method "' . $node->name->name . '()" supports only ' . $candidate['maximumNumberOfArguments'] . ' arguments.';
                     $match['restFiles'] = array_unique(array_merge($match['restFiles'], $candidate['restFiles']));
                 }
             }
index 87fdc36..928df2d 100644 (file)
@@ -55,7 +55,7 @@ class MethodArgumentDroppedStaticMatcher extends AbstractCoreMatcher
 
             if ($node->class instanceof FullyQualified) {
                 // 'Foo\Bar::aMethod()' -> strong match
-                $fqdnClassWithMethod = $node->class->toString() . '::' . $node->name;
+                $fqdnClassWithMethod = $node->class->toString() . '::' . $node->name->name;
                 if (!$isArgumentUnpackingUsed
                     && in_array($fqdnClassWithMethod, array_keys($this->matcherDefinitions), true)
                     && count($node->args) > $this->matcherDefinitions[$fqdnClassWithMethod]['maximumNumberOfArguments']
@@ -63,14 +63,14 @@ class MethodArgumentDroppedStaticMatcher extends AbstractCoreMatcher
                     $this->matches[] = [
                         'restFiles' => $this->matcherDefinitions[$fqdnClassWithMethod]['restFiles'],
                         'line' => $node->getAttribute('startLine'),
-                        'message' => 'Method "' . $node->name . '()" supports only '
+                        'message' => 'Method "' . $node->name->name . '()" supports only '
                             . $this->matcherDefinitions[$fqdnClassWithMethod]['maximumNumberOfArguments']
                             . ' arguments.',
                         'indicator' => 'strong',
                     ];
                 }
             } elseif ($node->class instanceof Variable
-                && in_array($node->name, array_keys($this->flatMatcherDefinitions), true)
+                && in_array($node->name->name, array_keys($this->flatMatcherDefinitions), true)
             ) {
                 $match = [
                     'restFiles' => [],
@@ -80,14 +80,14 @@ class MethodArgumentDroppedStaticMatcher extends AbstractCoreMatcher
 
                 $numberOfArguments = count($node->args);
                 $isPossibleMatch = false;
-                foreach ($this->flatMatcherDefinitions[$node->name]['candidates'] as $candidate) {
+                foreach ($this->flatMatcherDefinitions[$node->name->name]['candidates'] as $candidate) {
                     // A method call is considered a match if it is not called with argument unpacking
                     // and number of used arguments is higher than maximumNumberOfArguments
                     if (!$isArgumentUnpackingUsed
                         && $numberOfArguments > $candidate['maximumNumberOfArguments']
                     ) {
                         $isPossibleMatch = true;
-                        $match['message'] = 'Method "' . $node->name . '()" supports only '
+                        $match['message'] = 'Method "' . $node->name->name . '()" supports only '
                             . $candidate['maximumNumberOfArguments'] . ' arguments.';
                         $match['restFiles'] = array_unique(array_merge($match['restFiles'], $candidate['restFiles']));
                     }
index 5a7aa07..9f168c6 100644 (file)
@@ -49,7 +49,7 @@ class MethodArgumentRequiredMatcher extends AbstractCoreMatcher
         if (!$this->isFileIgnored($node)
             && !$this->isLineIgnored($node)
             && $node instanceof MethodCall
-            && in_array($node->name, array_keys($this->flatMatcherDefinitions), true)
+            && in_array($node->name->name, array_keys($this->flatMatcherDefinitions), true)
         ) {
             $match = [
                 'restFiles' => [],
@@ -61,7 +61,7 @@ class MethodArgumentRequiredMatcher extends AbstractCoreMatcher
 
             $numberOfArguments = count($node->args);
             $isPossibleMatch = false;
-            foreach ($this->flatMatcherDefinitions[$node->name]['candidates'] as $candidate) {
+            foreach ($this->flatMatcherDefinitions[$node->name->name]['candidates'] as $candidate) {
                 // A method call is considered a match if it is not called with argument unpacking
                 // and number of used arguments is lower than numberOfMandatoryArguments
                 if (!$isArgumentUnpackingUsed
@@ -69,7 +69,7 @@ class MethodArgumentRequiredMatcher extends AbstractCoreMatcher
                     && $numberOfArguments <= $candidate['maximumNumberOfArguments']
                 ) {
                     $isPossibleMatch = true;
-                    $match['message'] = 'Method ' . $node->name . '() needs at least ' . $candidate['numberOfMandatoryArguments'] . ' arguments.';
+                    $match['message'] = 'Method ' . $node->name->name . '() needs at least ' . $candidate['numberOfMandatoryArguments'] . ' arguments.';
                     $match['restFiles'] = array_unique(array_merge($match['restFiles'], $candidate['restFiles']));
                 }
             }
index 11b3b41..f3d732f 100644 (file)
@@ -55,7 +55,7 @@ class MethodArgumentRequiredStaticMatcher extends AbstractCoreMatcher
 
             if ($node->class instanceof FullyQualified) {
                 // 'Foo\Bar::aMethod()' -> strong match
-                $fqdnClassWithMethod = $node->class->toString() . '::' . $node->name;
+                $fqdnClassWithMethod = $node->class->toString() . '::' . $node->name->name;
                 $numberOfArguments = count($node->args);
                 if (!$isArgumentUnpackingUsed
                     && in_array($fqdnClassWithMethod, array_keys($this->matcherDefinitions), true)
@@ -66,14 +66,14 @@ class MethodArgumentRequiredStaticMatcher extends AbstractCoreMatcher
                     $this->matches[] = [
                         'restFiles' => $this->matcherDefinitions[$fqdnClassWithMethod]['restFiles'],
                         'line' => $node->getAttribute('startLine'),
-                        'message' => 'Method "' . $node->name . '()" needs at least '
+                        'message' => 'Method "' . $node->name->name . '()" needs at least '
                             . $this->matcherDefinitions[$fqdnClassWithMethod]['numberOfMandatoryArguments']
                             . ' arguments.',
                         'indicator' => 'strong',
                     ];
                 }
             } elseif ($node->class instanceof Variable
-                && in_array($node->name, array_keys($this->flatMatcherDefinitions), true)
+                && in_array($node->name->name, array_keys($this->flatMatcherDefinitions), true)
             ) {
                 $match = [
                     'restFiles' => [],
@@ -83,7 +83,7 @@ class MethodArgumentRequiredStaticMatcher extends AbstractCoreMatcher
 
                 $numberOfArguments = count($node->args);
                 $isPossibleMatch = false;
-                foreach ($this->flatMatcherDefinitions[$node->name]['candidates'] as $candidate) {
+                foreach ($this->flatMatcherDefinitions[$node->name->name]['candidates'] as $candidate) {
                     // A method call is considered a match if it is not called with argument unpacking
                     // and number of used arguments is lesser than numberOfMandatoryArguments
                     if (!$isArgumentUnpackingUsed
@@ -92,7 +92,7 @@ class MethodArgumentRequiredStaticMatcher extends AbstractCoreMatcher
                         && $numberOfArguments <= $candidate['maximumNumberOfArguments']
                     ) {
                         $isPossibleMatch = true;
-                        $match['message'] = 'Method "' . $node->name . '()" needs at least '
+                        $match['message'] = 'Method "' . $node->name->name . '()" needs at least '
                             . $candidate['numberOfMandatoryArguments'] . ' arguments.';
                         $match['restFiles'] = array_unique(array_merge($match['restFiles'], $candidate['restFiles']));
                     }
index f07fd29..f9c494d 100644 (file)
@@ -51,7 +51,7 @@ class MethodArgumentUnusedMatcher extends AbstractCoreMatcher
         if (!$this->isFileIgnored($node)
             && !$this->isLineIgnored($node)
             && $node instanceof MethodCall
-            && in_array($node->name, array_keys($this->flatMatcherDefinitions), true)
+            && in_array($node->name->name, array_keys($this->flatMatcherDefinitions), true)
         ) {
             $match = [
                 'restFiles' => [],
@@ -63,18 +63,18 @@ class MethodArgumentUnusedMatcher extends AbstractCoreMatcher
 
             $numberOfArguments = count($node->args);
             $isPossibleMatch = false;
-            foreach ($this->flatMatcherDefinitions[$node->name]['candidates'] as $candidate) {
+            foreach ($this->flatMatcherDefinitions[$node->name->name]['candidates'] as $candidate) {
                 foreach ($candidate['unusedArgumentNumbers'] as $droppedArgumentNumber) {
                     // A method call is considered a match if name matches, unpacking is not used
                     // and the registered argument is not given as null.
                     if (!$isArgumentUnpackingUsed
                         && $numberOfArguments >= $droppedArgumentNumber
                         && !($node->args[$droppedArgumentNumber - 1]->value instanceof ConstFetch)
-                        && (!isset($node->args[$droppedArgumentNumber - 1]->value->name->parts[0])
-                            || $node->args[$droppedArgumentNumber - 1]->value->name->parts[0] !== null)
+                        && (!isset($node->args[$droppedArgumentNumber - 1]->value->name->name->parts[0])
+                            || $node->args[$droppedArgumentNumber - 1]->value->name->name->parts[0] !== null)
                     ) {
                         $isPossibleMatch = true;
-                        $match['message'] = 'Call to method "' . $node->name . '()" with'
+                        $match['message'] = 'Call to method "' . $node->name->name . '()" with'
                             . ' argument ' . $droppedArgumentNumber . ' not given as null.';
                         $match['restFiles'] = array_unique(array_merge($match['restFiles'], $candidate['restFiles']));
                     }
index b634c70..0845a5b 100644 (file)
@@ -49,12 +49,12 @@ class MethodCallMatcher extends AbstractCoreMatcher
         if (!$this->isFileIgnored($node)
             && !$this->isLineIgnored($node)
             && $node instanceof MethodCall
-            && in_array($node->name, array_keys($this->flatMatcherDefinitions), true)
+            && in_array($node->name->name, array_keys($this->flatMatcherDefinitions), true)
         ) {
             $match = [
                 'restFiles' => [],
                 'line' => $node->getAttribute('startLine'),
-                'message' => 'Call to method "' . $node->name . '()"',
+                'message' => 'Call to method "' . $node->name->name . '()"',
                 'indicator' => 'weak',
             ];
 
@@ -62,7 +62,7 @@ class MethodCallMatcher extends AbstractCoreMatcher
             $isArgumentUnpackingUsed = $this->isArgumentUnpackingUsed($node->args);
 
             $isPossibleMatch = false;
-            foreach ($this->flatMatcherDefinitions[$node->name]['candidates'] as $candidate) {
+            foreach ($this->flatMatcherDefinitions[$node->name->name]['candidates'] as $candidate) {
                 // A method call is considered a match if it is called with argument unpacking, or
                 // if the number of given arguments is within range of mandatory / max number of arguments
                 if ($isArgumentUnpackingUsed
index 67566d4..93bd5fd 100644 (file)
@@ -61,7 +61,7 @@ class MethodCallStaticMatcher extends AbstractCoreMatcher
         ) {
             if ($node->class instanceof FullyQualified) {
                 // 'Foo\Bar::deprecated()' -> strong match
-                $fqdnClassWithMethod = $node->class->toString() . '::' . $node->name;
+                $fqdnClassWithMethod = $node->class->toString() . '::' . $node->name->name;
                 if (in_array($fqdnClassWithMethod, array_keys($this->matcherDefinitions), true)) {
                     $this->matches[] = [
                         'restFiles' => $this->matcherDefinitions[$fqdnClassWithMethod]['restFiles'],
@@ -71,12 +71,12 @@ class MethodCallStaticMatcher extends AbstractCoreMatcher
                     ];
                 }
             } elseif ($node->class instanceof Variable
-                && in_array($node->name, array_keys($this->flatMatcherDefinitions), true)
+                && in_array($node->name->name, array_keys($this->flatMatcherDefinitions), true)
             ) {
                 $match = [
                     'restFiles' => [],
                     'line' => $node->getAttribute('startLine'),
-                    'message' => 'Use of static class method call "' . $node->name . '()"',
+                    'message' => 'Use of static class method call "' . $node->name->name . '()"',
                     'indicator' => 'weak',
                 ];
 
@@ -84,7 +84,7 @@ class MethodCallStaticMatcher extends AbstractCoreMatcher
                 $isArgumentUnpackingUsed = $this->isArgumentUnpackingUsed($node->args);
 
                 $isPossibleMatch = false;
-                foreach ($this->flatMatcherDefinitions[$node->name]['candidates'] as $candidate) {
+                foreach ($this->flatMatcherDefinitions[$node->name->name]['candidates'] as $candidate) {
                     // A method call is considered a match if it is called with argument unpacking, or
                     // if the number of given arguments is within range of mandatory / max number of arguments
                     if ($isArgumentUnpackingUsed
index b614a45..8f63237 100644 (file)
@@ -47,13 +47,13 @@ class PropertyExistsStaticMatcher extends AbstractCoreMatcher
             && $node instanceof Property
             && $node->isStatic()
             && !$node->isPrivate()
-            && in_array($node->props[0]->name, array_keys($this->matcherDefinitions), true)
+            && in_array($node->props[0]->name->name, array_keys($this->matcherDefinitions), true)
         ) {
-            $propertyName = $node->props[0]->name;
+            $propertyName = $node->props[0]->name->name;
             $match = [
                 'restFiles' => $this->matcherDefinitions[$propertyName]['restFiles'],
                 'line' => $node->getAttribute('startLine'),
-                'message' => 'Use of property "' . $node->props[0]->name . '"',
+                'message' => 'Use of property "' . $node->props[0]->name->name . '"',
                 'indicator' => 'weak',
             ];
             $this->matches[] = $match;
index 7eec2a2..b1e70c9 100644 (file)
@@ -17,6 +17,7 @@ namespace TYPO3\CMS\Install\ExtensionScanner\Php\Matcher;
 
 use PhpParser\Node;
 use PhpParser\Node\Expr\PropertyFetch;
+use PhpParser\Node\Identifier;
 
 /**
  * Find usages of properties which have been made protected and are
@@ -46,17 +47,18 @@ class PropertyProtectedMatcher extends AbstractCoreMatcher
         if (!$this->isFileIgnored($node)
             && !$this->isLineIgnored($node)
             && $node instanceof PropertyFetch
+            && $node->name instanceof Identifier
             && $node->var->name !== 'this'
-            && in_array($node->name, array_keys($this->flatMatcherDefinitions), true)
+            && in_array($node->name->name, array_keys($this->flatMatcherDefinitions), true)
         ) {
             $match = [
                 'restFiles' => [],
                 'line' => $node->getAttribute('startLine'),
-                'message' => 'Fetch of property "' . $node->name . '"',
+                'message' => 'Fetch of property "' . $node->name->name . '"',
                 'indicator' => 'weak',
             ];
 
-            foreach ($this->flatMatcherDefinitions[$node->name]['candidates'] as $candidate) {
+            foreach ($this->flatMatcherDefinitions[$node->name->name]['candidates'] as $candidate) {
                 $match['restFiles'] = array_unique(array_merge($match['restFiles'], $candidate['restFiles']));
             }
             $this->matches[] = $match;
index 3e7108b..7628b18 100644 (file)
@@ -17,6 +17,7 @@ namespace TYPO3\CMS\Install\ExtensionScanner\Php\Matcher;
 
 use PhpParser\Node;
 use PhpParser\Node\Expr\PropertyFetch;
+use PhpParser\Node\Identifier;
 
 /**
  * Find usages of properties which were removed / deprecated.
@@ -46,16 +47,17 @@ class PropertyPublicMatcher extends AbstractCoreMatcher
         if (!$this->isFileIgnored($node)
             && !$this->isLineIgnored($node)
             && $node instanceof PropertyFetch
-            && in_array($node->name, array_keys($this->flatMatcherDefinitions), true)
+            && $node->name instanceof Identifier
+            && in_array($node->name->name, array_keys($this->flatMatcherDefinitions), true)
         ) {
             $match = [
                 'restFiles' => [],
                 'line' => $node->getAttribute('startLine'),
-                'message' => 'Fetch of property "' . $node->name . '"',
+                'message' => 'Fetch of property "' . $node->name->name . '"',
                 'indicator' => 'weak',
             ];
 
-            foreach ($this->flatMatcherDefinitions[$node->name]['candidates'] as $candidate) {
+            foreach ($this->flatMatcherDefinitions[$node->name->name]['candidates'] as $candidate) {
                 $match['restFiles'] = array_unique(array_merge($match['restFiles'], $candidate['restFiles']));
             }
             $this->matches[] = $match;
index 2d46c60..d95e4fe 100644 (file)
@@ -40,8 +40,8 @@ EOC;
         $traverser = new NodeTraverser();
         $traverser->addVisitor(new GeneratorClassesResolver());
         $statements = $traverser->traverse($statements);
-        $this->assertInstanceOf(FullyQualified::class, $statements[0]->args[0]->value);
-        $this->assertEquals([ 'TYPO3', 'CMS', 'Does', 'Not', 'Exist'], $statements[0]->args[0]->value->parts);
+        $this->assertInstanceOf(FullyQualified::class, $statements[0]->expr->args[0]->value);
+        $this->assertEquals(['TYPO3', 'CMS', 'Does', 'Not', 'Exist'], $statements[0]->expr->args[0]->value->parts);
     }
 
     /**
@@ -58,6 +58,6 @@ EOC;
         $traverser = new NodeTraverser();
         $traverser->addVisitor(new GeneratorClassesResolver());
         $statements = $traverser->traverse($statements);
-        $this->assertNotInstanceOf(FullyQualified::class, $statements[0]->args[0]->value);
+        $this->assertNotInstanceOf(FullyQualified::class, $statements[0]->expr->args[0]->value);
     }
 }
index 4077a9a..7c95160 100644 (file)
@@ -13,7 +13,7 @@
                "sort-packages": true
        },
        "require": {
-               "nikic/php-parser": "^3.1",
+               "nikic/php-parser": "^4.0",
                "symfony/finder": "^2.7 || ^3.0 || ^4.0",
                "typo3/cms-core": "9.3.*@dev",
                "typo3/cms-extbase": "9.3.*@dev",