We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b4ecd33 commit e07ded6Copy full SHA for e07ded6
src/Analyser/NodeScopeResolver.php
@@ -5496,7 +5496,13 @@ private function processAssignVar(
5496
}
5497
5498
if ($originalVar->dim instanceof Variable || $originalVar->dim instanceof Node\Scalar) {
5499
- if (!$scope->hasExpressionType($originalVar)->yes()) {
+ $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()) {
5506
$scope = $scope->assignExpression(
5507
$originalVar,
5508
$originalValueToWrite,
0 commit comments