Skip to content

Commit 8fa9c86

Browse files
committed
prevent duplicated work
1 parent ffd297a commit 8fa9c86

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
@@ -3705,7 +3705,8 @@ private function enterAnonymousFunctionWithoutReflection(
37053705
$nativeTypes[$paramExprString] = ExpressionTypeHolder::createYes($use->var, $variableNativeType);
37063706
}
37073707

3708-
foreach ($this->invalidateStaticExpressions($this->expressionTypes) as $exprString => $typeHolder) {
3708+
$nonStaticExpressions = $this->invalidateStaticExpressions($this->expressionTypes);
3709+
foreach ($nonStaticExpressions as $exprString => $typeHolder) {
37093710
$expr = $typeHolder->getExpr();
37103711

37113712
if ($expr instanceof Variable) {
@@ -3735,7 +3736,7 @@ private function enterAnonymousFunctionWithoutReflection(
37353736
$nativeTypes['$this'] = ExpressionTypeHolder::createYes($node, $this->getNativeType($node));
37363737

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

37413742
if (

0 commit comments

Comments
 (0)