Skip to content

Commit 54db532

Browse files
committed
prevent duplicated work
1 parent 98f5558 commit 54db532

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Analyser/MutatingScope.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3735,7 +3735,8 @@ private function enterAnonymousFunctionWithoutReflection(
37353735
$nativeTypes[$paramExprString] = ExpressionTypeHolder::createYes($use->var, $variableNativeType);
37363736
}
37373737

3738-
foreach ($this->invalidateStaticExpressions($this->expressionTypes) as $exprString => $typeHolder) {
3738+
$nonStaticExpressions = $this->invalidateStaticExpressions($this->expressionTypes);
3739+
foreach ($nonStaticExpressions as $exprString => $typeHolder) {
37393740
$expr = $typeHolder->getExpr();
37403741

37413742
if ($expr instanceof Variable) {
@@ -3765,7 +3766,7 @@ private function enterAnonymousFunctionWithoutReflection(
37653766
$nativeTypes['$this'] = ExpressionTypeHolder::createYes($node, $this->getNativeType($node));
37663767

37673768
if ($this->phpVersion->supportsReadOnlyProperties()) {
3768-
foreach ($this->invalidateStaticExpressions($this->expressionTypes) as $exprString => $typeHolder) {
3769+
foreach ($nonStaticExpressions as $exprString => $typeHolder) {
37693770
$expr = $typeHolder->getExpr();
37703771

37713772
if (

0 commit comments

Comments
 (0)