diff --git a/src/Config/RectorConfig.php b/src/Config/RectorConfig.php index deeb9ea9ff3..4802bd9891e 100644 --- a/src/Config/RectorConfig.php +++ b/src/Config/RectorConfig.php @@ -5,9 +5,7 @@ namespace Rector\Config; use Composer\Semver\Semver; -use Deprecated; use Entropy\Container\Container; -use Rector\Caching\Contract\ValueObject\Storage\CacheStorageInterface; use Rector\Composer\InstalledPackageResolver; use Rector\Configuration\Option; use Rector\Configuration\Parameter\SimpleParameterProvider; @@ -460,19 +458,6 @@ public function containerCacheDirectory(string $directoryPath): void SimpleParameterProvider::setParameter(Option::CONTAINER_CACHE_DIRECTORY, $directoryPath); } - /** - * @param class-string $cacheClass - */ - #[Deprecated(message: <<<'TXT' - Cache storage is selected automatically: file cache locally, in-memory cache in CI, - where the ephemeral workspace makes writing a cache that is never re-read wasted IO. - The passed value is ignored. - TXT)] - public function cacheClass(string $cacheClass): void - { - Assert::isAOf($cacheClass, CacheStorageInterface::class); - } - /** * @see https://github.com/nikic/PHP-Parser/issues/723#issuecomment-712401963 */ diff --git a/src/NodeAnalyzer/ScopeAnalyzer.php b/src/NodeAnalyzer/ScopeAnalyzer.php index 1734898b92e..00e4aa06d67 100644 --- a/src/NodeAnalyzer/ScopeAnalyzer.php +++ b/src/NodeAnalyzer/ScopeAnalyzer.php @@ -6,15 +6,17 @@ use PhpParser\Node; use PhpParser\Node\ComplexType; +use PhpParser\Node\Expr\BinaryOp\Spaceship; use PhpParser\Node\Identifier; use PhpParser\Node\Name; +use PhpParser\Node\Stmt\Break_; final class ScopeAnalyzer { /** * @var array> */ - private const array NON_REFRESHABLE_NODES = [Name::class, Identifier::class, ComplexType::class]; + private const array NON_REFRESHABLE_NODES = [Name::class, Identifier::class, ComplexType::class, Break_::class, Spaceship::class]; public function isRefreshable(Node $node): bool { diff --git a/src/NodeTypeResolver/PHPStan/Scope/PHPStanNodeScopeResolver.php b/src/NodeTypeResolver/PHPStan/Scope/PHPStanNodeScopeResolver.php index 106480e27a9..384f6c6cbeb 100644 --- a/src/NodeTypeResolver/PHPStan/Scope/PHPStanNodeScopeResolver.php +++ b/src/NodeTypeResolver/PHPStan/Scope/PHPStanNodeScopeResolver.php @@ -468,6 +468,10 @@ private function nodeScopeResolverProcessNodes( private function processCallLike(CallLike $callLike, MutatingScope $mutatingScope): void { + if ($callLike->isFirstClassCallable()) { + return; + } + if ($callLike instanceof StaticCall) { $callLike->class->setAttribute(AttributeKey::SCOPE, $mutatingScope); $callLike->name->setAttribute(AttributeKey::SCOPE, $mutatingScope); @@ -480,10 +484,6 @@ private function processCallLike(CallLike $callLike, MutatingScope $mutatingScop $callLike->class->setAttribute(AttributeKey::SCOPE, $mutatingScope); } - if ($callLike->isFirstClassCallable()) { - return; - } - foreach ($callLike->getArgs() as $arg) { $arg->value->setAttribute(AttributeKey::SCOPE, $mutatingScope); }