File tree Expand file tree Collapse file tree 1 file changed +5
-10
lines changed
Expand file tree Collapse file tree 1 file changed +5
-10
lines changed Original file line number Diff line number Diff line change 1212use PHPStan \Rules \FunctionCallParametersCheck ;
1313use PHPStan \Rules \IdentifierRuleError ;
1414use PHPStan \Rules \Rule ;
15- use PHPStan \Type \Constant \ConstantStringType ;
16- use function array_column ;
17- use function array_map ;
1815use function array_merge ;
1916
2017/**
@@ -42,13 +39,11 @@ public function processNode(Node $node, Scope $scope): array
4239 $ methodNameScopes = [$ node ->name ->name => $ scope ];
4340 } else {
4441 $ nameType = $ scope ->getType ($ node ->name );
45- $ methodNameScopes = array_column (array_map (
46- static fn (ConstantStringType $ constantString ) => [
47- $ name = $ constantString ->getValue (),
48- $ scope ->filterByTruthyValue (new Identical ($ node ->name , new String_ ($ name ))),
49- ],
50- $ nameType ->getConstantStrings (),
51- ), 1 , 0 );
42+ $ methodNameScopes = [];
43+ foreach ($ nameType ->getConstantStrings () as $ constantString ) {
44+ $ name = $ constantString ->getValue ();
45+ $ methodNameScopes [$ name ] = $ scope ->filterByTruthyValue (new Identical ($ node ->name , new String_ ($ name )));
46+ }
5247 }
5348
5449 foreach ($ methodNameScopes as $ methodName => $ methodScope ) {
You can’t perform that action at this time.
0 commit comments