diff --git a/rules-tests/TypeDeclaration/Rector/Property/TypedPropertyFromAssignsRector/Fixture/partial_application.php.inc b/rules-tests/TypeDeclaration/Rector/Property/TypedPropertyFromAssignsRector/Fixture/partial_application.php.inc new file mode 100644 index 00000000000..27fc3660fa1 --- /dev/null +++ b/rules-tests/TypeDeclaration/Rector/Property/TypedPropertyFromAssignsRector/Fixture/partial_application.php.inc @@ -0,0 +1,31 @@ +data = array_map(trim(?), [' x ']); + } +} + +?> +----- +data = array_map(trim(?), [' x ']); + } +} + +?> \ No newline at end of file diff --git a/src/NodeTypeResolver/PHPStan/Scope/PHPStanNodeScopeResolver.php b/src/NodeTypeResolver/PHPStan/Scope/PHPStanNodeScopeResolver.php index 33060c93aec..648912e32c4 100644 --- a/src/NodeTypeResolver/PHPStan/Scope/PHPStanNodeScopeResolver.php +++ b/src/NodeTypeResolver/PHPStan/Scope/PHPStanNodeScopeResolver.php @@ -394,7 +394,7 @@ private function processCallLike(CallLike $callLike, MutatingScope $mutatingScop $callLike->class->setAttribute(AttributeKey::SCOPE, $mutatingScope); } - if ($callLike->isFirstClassCallable()) { + if ($callLike->isPartialFunctionApplication()) { return; } diff --git a/src/PhpParser/NodeVisitor/CallLikeReflectionNodeVisitor.php b/src/PhpParser/NodeVisitor/CallLikeReflectionNodeVisitor.php index f1ad79f82c3..a332086e418 100644 --- a/src/PhpParser/NodeVisitor/CallLikeReflectionNodeVisitor.php +++ b/src/PhpParser/NodeVisitor/CallLikeReflectionNodeVisitor.php @@ -45,7 +45,7 @@ public function enterNode(Node $node): ?Node return null; } - if ($node->isFirstClassCallable()) { + if ($node->isPartialFunctionApplication()) { return null; } diff --git a/src/PhpParser/NodeVisitor/NameAndArgNodeVisitor.php b/src/PhpParser/NodeVisitor/NameAndArgNodeVisitor.php index 7e646c0417f..a7b0191e451 100644 --- a/src/PhpParser/NodeVisitor/NameAndArgNodeVisitor.php +++ b/src/PhpParser/NodeVisitor/NameAndArgNodeVisitor.php @@ -27,7 +27,7 @@ public function enterNode(Node $node): ?Node if ($node instanceof FuncCall && $node->name instanceof Name) { $node->name->setAttribute(AttributeKey::IS_FUNCCALL_NAME, true); - if (! $node->isFirstClassCallable()) { + if (! $node->isPartialFunctionApplication()) { $funcCallName = $node->name->toString(); foreach ($node->getArgs() as $arg) { $arg->value->setAttribute(AttributeKey::FROM_FUNC_CALL_NAME, $funcCallName);