Skip to content

Commit a4bc821

Browse files
committed
Update MutatingScope.php
1 parent c4848ea commit a4bc821

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/Analyser/MutatingScope.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -803,6 +803,8 @@ public function getType(Expr $node): Type
803803
return $this->initializerExprTypeResolver->getType($node, InitializerExprContext::fromScope($this));
804804
} elseif ($node instanceof Node\Scalar\Float_) {
805805
return $this->initializerExprTypeResolver->getType($node, InitializerExprContext::fromScope($this));
806+
} elseif ($node instanceof Expr\UnaryMinus && $node->expr instanceof Node\Scalar) {
807+
return $this->initializerExprTypeResolver->getType($node, InitializerExprContext::fromScope($this));
806808
} elseif ($node instanceof ConstFetch) {
807809
$loweredConstName = strtolower($node->name->toString());
808810
if (in_array($loweredConstName, ['true', 'false', 'null'], true)) {

0 commit comments

Comments
 (0)