Skip to content

Commit e07ded6

Browse files
committed
Update NodeScopeResolver.php
1 parent b4ecd33 commit e07ded6

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/Analyser/NodeScopeResolver.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5496,7 +5496,13 @@ private function processAssignVar(
54965496
}
54975497

54985498
if ($originalVar->dim instanceof Variable || $originalVar->dim instanceof Node\Scalar) {
5499-
if (!$scope->hasExpressionType($originalVar)->yes()) {
5499+
$type = $this->treatPhpDocTypesAsCertain
5500+
? $scope->getType($originalVar->var)
5501+
: $scope->getNativeType($originalVar->var);
5502+
$dimType = $this->treatPhpDocTypesAsCertain
5503+
? $scope->getType($originalVar->dim)
5504+
: $scope->getNativeType($originalVar->dim);
5505+
if (!$type->hasOffsetValueType($dimType)->yes()) {
55005506
$scope = $scope->assignExpression(
55015507
$originalVar,
55025508
$originalValueToWrite,

0 commit comments

Comments
 (0)