Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions src/Config/RectorConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -460,19 +458,6 @@ public function containerCacheDirectory(string $directoryPath): void
SimpleParameterProvider::setParameter(Option::CONTAINER_CACHE_DIRECTORY, $directoryPath);
}

/**
* @param class-string<CacheStorageInterface> $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
*/
Expand Down
4 changes: 3 additions & 1 deletion src/NodeAnalyzer/ScopeAnalyzer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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<class-string<Node>>
*/
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
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
}
Expand Down
Loading