Skip to content

Commit 263c20a

Browse files
phpstan-botclaude
andcommitted
Use elseif for mutually exclusive constant array check
The two branches in setExistingOffsetValueType() are mutually exclusive (first checks isConstantArray()->yes(), second checks !isConstantArray()->yes()), so use elseif to make this explicit and save unnecessary condition evaluation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent d77e08d commit 263c20a

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

src/Type/ArrayType.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -408,9 +408,7 @@ public function setExistingOffsetValueType(Type $offsetType, Type $valueType): T
408408
$newItemType,
409409
);
410410
}
411-
}
412-
413-
if (
411+
} elseif (
414412
$this->itemType->isArray()->yes()
415413
&& !$this->itemType->isConstantArray()->yes()
416414
&& $valueType->isArray()->yes()

0 commit comments

Comments
 (0)