Skip to content

Commit b32b813

Browse files
committed
Update NonNullabilityHelper.php
1 parent b4e90de commit b32b813

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/Analyser/ExprHandler/Helper/NonNullabilityHelper.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,10 @@ public function ensureShallowNonNullability(MutatingScope $scope, Scope $origina
3232
// keep certainty
3333
$certainty = TrinaryLogic::createYes();
3434
$hasExpressionType = $originalScope->hasExpressionType($exprToSpecify);
35-
if (!$hasExpressionType->no() || $exprToSpecify instanceof ArrayDimFetch) {
35+
if (
36+
!$hasExpressionType->no()
37+
|| ($exprType->isArray()->yes() && $exprToSpecify instanceof ArrayDimFetch)
38+
) {
3639
$certainty = $hasExpressionType;
3740
}
3841

0 commit comments

Comments
 (0)