From 8cd1b8a88ebdc81e5c3fba2a8e522d196a96a096 Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Wed, 11 Dec 2024 18:53:52 +0000 Subject: [PATCH] Updated Rector to commit 7f9dae6ddcce4331acb1058a47d9947ee1b87c17 https://github.com/rectorphp/rector-src/commit/7f9dae6ddcce4331acb1058a47d9947ee1b87c17 [CodeQuality] More handling on Function/Static/Instantition callable node on OptionalParametersAfterRequiredRector (#6558) --- src/Application/VersionResolver.php | 4 ++-- .../PHPStan/Scope/PHPStanNodeScopeResolver.php | 9 ++++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/Application/VersionResolver.php b/src/Application/VersionResolver.php index 46d1a9c7e71..a5c8321b87a 100644 --- a/src/Application/VersionResolver.php +++ b/src/Application/VersionResolver.php @@ -19,12 +19,12 @@ final class VersionResolver * @api * @var string */ - public const PACKAGE_VERSION = 'cce509740aef05ae9eb8640090388489d841185b'; + public const PACKAGE_VERSION = '7f9dae6ddcce4331acb1058a47d9947ee1b87c17'; /** * @api * @var string */ - public const RELEASE_DATE = '2024-12-11 17:23:52'; + public const RELEASE_DATE = '2024-12-12 01:51:18'; /** * @var int */ diff --git a/src/NodeTypeResolver/PHPStan/Scope/PHPStanNodeScopeResolver.php b/src/NodeTypeResolver/PHPStan/Scope/PHPStanNodeScopeResolver.php index a66b3ae8964..2e0e58b2600 100644 --- a/src/NodeTypeResolver/PHPStan/Scope/PHPStanNodeScopeResolver.php +++ b/src/NodeTypeResolver/PHPStan/Scope/PHPStanNodeScopeResolver.php @@ -86,8 +86,11 @@ use PhpParser\NodeTraverser; use PHPStan\Analyser\MutatingScope; use PHPStan\Analyser\NodeScopeResolver; use PHPStan\Analyser\ScopeContext; +use PHPStan\Node\FunctionCallableNode; +use PHPStan\Node\InstantiationCallableNode; use PHPStan\Node\MethodCallableNode; use PHPStan\Node\Printer\Printer; +use PHPStan\Node\StaticMethodCallableNode; use PHPStan\Node\UnreachableStatementNode; use PHPStan\Node\VirtualNode; use PHPStan\Parser\ParserErrorsException; @@ -328,10 +331,10 @@ final class PHPStanNodeScopeResolver $node->cond->setAttribute(AttributeKey::SCOPE, $mutatingScope); return; } - if ($node instanceof MethodCallableNode) { + if ($node instanceof MethodCallableNode || $node instanceof FunctionCallableNode || $node instanceof StaticMethodCallableNode || $node instanceof InstantiationCallableNode) { $node->getOriginalNode()->setAttribute(AttributeKey::SCOPE, $mutatingScope); - $node->getOriginalNode()->var->setAttribute(AttributeKey::SCOPE, $mutatingScope); - $node->getOriginalNode()->name->setAttribute(AttributeKey::SCOPE, $mutatingScope); + $this->processCallike($node->getOriginalNode(), $mutatingScope); + return; } }; try {