Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/1.11.x' into test/box
Browse files Browse the repository at this point in the history
  • Loading branch information
theofidry committed Feb 4, 2024
2 parents 57f7a21 + fae4a14 commit 61564da
Show file tree
Hide file tree
Showing 7 changed files with 3,917 additions and 3,381 deletions.
4 changes: 4 additions & 0 deletions src/Analyser/MutatingScope.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
use PHPStan\Node\Expr\PropertyInitializationExpr;
use PHPStan\Node\Expr\SetOffsetValueTypeExpr;
use PHPStan\Node\Expr\TypeExpr;
use PHPStan\Node\Expr\UnsetOffsetExpr;
use PHPStan\Node\IssetExpr;
use PHPStan\Node\Printer\ExprPrinter;
use PHPStan\Parser\ArrayMapArgVisitor;
Expand Down Expand Up @@ -697,6 +698,9 @@ public function getType(Expr $node): Type
if ($node instanceof GetOffsetValueTypeExpr) {
return $this->getType($node->getVar())->getOffsetValueType($this->getType($node->getDim()));
}
if ($node instanceof UnsetOffsetExpr) {
return $this->getType($node->getVar())->unsetOffset($this->getType($node->getDim()));
}
if ($node instanceof SetOffsetValueTypeExpr) {
return $this->getType($node->getVar())->setOffsetValueType($node->getDim() !== null ? $this->getType($node->getDim()) : null, $this->getType($node->getValue()));
}
Expand Down
Loading

0 comments on commit 61564da

Please sign in to comment.