Updated Rector to commit 05e8819c7106c4f98a6373c8b2da4e283242d98b

05e8819c71 [CodeQuality] Handle crash on echo with first class callable on OptionalParametersAfterRequiredRector (#6553)
This commit is contained in:
Tomas Votruba 2024-12-11 16:15:15 +00:00
parent 287778d519
commit 6d5b413193
2 changed files with 13 additions and 2 deletions

View File

@ -19,12 +19,12 @@ final class VersionResolver
* @api
* @var string
*/
public const PACKAGE_VERSION = '22275db093192e212662b222e2ce804def71b6ed';
public const PACKAGE_VERSION = '05e8819c7106c4f98a6373c8b2da4e283242d98b';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2024-12-11 20:48:02';
public const RELEASE_DATE = '2024-12-11 23:12:43';
/**
* @var int
*/

View File

@ -61,6 +61,7 @@ use PhpParser\Node\Stmt\Class_;
use PhpParser\Node\Stmt\ClassConst;
use PhpParser\Node\Stmt\ClassLike;
use PhpParser\Node\Stmt\ClassMethod;
use PhpParser\Node\Stmt\Echo_;
use PhpParser\Node\Stmt\Enum_;
use PhpParser\Node\Stmt\EnumCase;
use PhpParser\Node\Stmt\Expression;
@ -312,6 +313,10 @@ final class PHPStanNodeScopeResolver
$this->processIssetOrUnset($node, $mutatingScope);
return;
}
if ($node instanceof Echo_) {
$this->processEcho($node, $mutatingScope);
return;
}
};
$this->nodeScopeResolverProcessNodes($stmts, $scope, $nodeCallback);
$nodeTraverser = new NodeTraverser();
@ -340,6 +345,12 @@ final class PHPStanNodeScopeResolver
$var->setAttribute(AttributeKey::SCOPE, $mutatingScope);
}
}
private function processEcho(Echo_ $echo, MutatingScope $mutatingScope) : void
{
foreach ($echo->exprs as $expr) {
$expr->setAttribute(AttributeKey::SCOPE, $mutatingScope);
}
}
private function processMatch(Match_ $match, MutatingScope $mutatingScope) : void
{
$match->cond->setAttribute(AttributeKey::SCOPE, $mutatingScope);