mirror of
https://github.com/rectorphp/rector.git
synced 2025-01-16 21:08:19 +01:00
Updated Rector to commit bf5270a8456ec1c6e45bbcaa8ad2aab6b5a4dfb6
bf5270a845
[CodeQuality] Handle crash first class callable on If/Elseif cond on OptionalParametersAfterRequiredRector (#6555)
This commit is contained in:
parent
be33c47b56
commit
c29f55fcfa
@ -19,12 +19,12 @@ final class VersionResolver
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const PACKAGE_VERSION = '33d12b758ef5726ae7cc174ef7fcac627cc71dea';
|
||||
public const PACKAGE_VERSION = 'bf5270a8456ec1c6e45bbcaa8ad2aab6b5a4dfb6';
|
||||
/**
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const RELEASE_DATE = '2024-12-11 23:43:12';
|
||||
public const RELEASE_DATE = '2024-12-12 00:08:37';
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
|
@ -63,7 +63,9 @@ use PhpParser\Node\Stmt\Class_;
|
||||
use PhpParser\Node\Stmt\ClassConst;
|
||||
use PhpParser\Node\Stmt\ClassLike;
|
||||
use PhpParser\Node\Stmt\ClassMethod;
|
||||
use PhpParser\Node\Stmt\Do_;
|
||||
use PhpParser\Node\Stmt\Echo_;
|
||||
use PhpParser\Node\Stmt\ElseIf_;
|
||||
use PhpParser\Node\Stmt\Enum_;
|
||||
use PhpParser\Node\Stmt\EnumCase;
|
||||
use PhpParser\Node\Stmt\Expression;
|
||||
@ -71,6 +73,7 @@ use PhpParser\Node\Stmt\Finally_;
|
||||
use PhpParser\Node\Stmt\For_;
|
||||
use PhpParser\Node\Stmt\Foreach_;
|
||||
use PhpParser\Node\Stmt\Function_;
|
||||
use PhpParser\Node\Stmt\If_;
|
||||
use PhpParser\Node\Stmt\Interface_;
|
||||
use PhpParser\Node\Stmt\Property;
|
||||
use PhpParser\Node\Stmt\Return_;
|
||||
@ -78,6 +81,7 @@ use PhpParser\Node\Stmt\Switch_;
|
||||
use PhpParser\Node\Stmt\Trait_;
|
||||
use PhpParser\Node\Stmt\TryCatch;
|
||||
use PhpParser\Node\Stmt\Unset_;
|
||||
use PhpParser\Node\Stmt\While_;
|
||||
use PhpParser\Node\UnionType;
|
||||
use PhpParser\NodeTraverser;
|
||||
use PHPStan\Analyser\MutatingScope;
|
||||
@ -319,6 +323,10 @@ final class PHPStanNodeScopeResolver
|
||||
$this->processEcho($node, $mutatingScope);
|
||||
return;
|
||||
}
|
||||
if ($node instanceof If_ || $node instanceof ElseIf_ || $node instanceof Do_ || $node instanceof While_) {
|
||||
$node->cond->setAttribute(AttributeKey::SCOPE, $mutatingScope);
|
||||
return;
|
||||
}
|
||||
};
|
||||
try {
|
||||
$this->nodeScopeResolverProcessNodes($stmts, $scope, $nodeCallback);
|
||||
@ -452,6 +460,7 @@ final class PHPStanNodeScopeResolver
|
||||
}
|
||||
private function processSwitch(Switch_ $switch, MutatingScope $mutatingScope) : void
|
||||
{
|
||||
$switch->cond->setAttribute(AttributeKey::SCOPE, $mutatingScope);
|
||||
// decorate value as well
|
||||
foreach ($switch->cases as $case) {
|
||||
$case->setAttribute(AttributeKey::SCOPE, $mutatingScope);
|
||||
|
Loading…
x
Reference in New Issue
Block a user