Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Dec 13, 2019
1 parent fe7bb6d commit fd2e954
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Analyser/MutatingScope.php
Original file line number Diff line number Diff line change
Expand Up @@ -2483,7 +2483,7 @@ public function unsetExpression(Expr $expr): self
);
}

return $this->invalidateExpression($expr->var);
return $this->invalidateExpression($expr->var)->invalidateExpression(new FuncCall(new Name('count'), [new Node\Arg($expr->var)]));
}

return $this;
Expand Down Expand Up @@ -2556,16 +2556,16 @@ public function invalidateExpression(Expr $expressionToInvalidate, bool $require
if ($requireMoreCharacters && $exprString === $exprStringToInvalidate) {
continue;
}
if (!Strings::startsWith($exprString, $exprStringToInvalidate)) {
continue;
}

if ($exprString === $exprStringToInvalidate) {
unset($moreSpecificTypeHolders[$exprString]);
continue;
}

$nextLetter = substr($exprString, strlen($exprStringToInvalidate), 1);
if (!is_string($nextLetter)) {
continue;
}
if (Strings::match($nextLetter, '#[a-zA-Z_0-9\x7f-\xff]#') !== null) {
continue;
}
Expand Down

0 comments on commit fd2e954

Please sign in to comment.