Skip to content

Commit 936d3cd

Browse files
committed
simplify
1 parent 0329ac7 commit 936d3cd

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

src/Analyser/NodeScopeResolver.php

-1
Original file line numberDiff line numberDiff line change
@@ -5943,7 +5943,6 @@ private function produceArrayDimFetchAssignValueToWrite(array $dimFetchStack, ar
59435943
$valueToWrite = TypeCombinator::intersect(
59445944
$valueToWrite,
59455945
$hasOffsetType,
5946-
new NonEmptyArrayType(),
59475946
);
59485947
} else {
59495948
$valueToWrite = TypeCombinator::intersect(

src/Type/ArrayType.php

+3-5
Original file line numberDiff line numberDiff line change
@@ -356,11 +356,9 @@ public function setOffsetValueType(?Type $offsetType, Type $valueType, bool $uni
356356

357357
public function setExistingOffsetValueType(Type $offsetType, Type $valueType): Type
358358
{
359-
return TypeCombinator::intersect(
360-
new self(
361-
$this->keyType,
362-
TypeCombinator::union($this->itemType, $valueType),
363-
),
359+
return new self(
360+
$this->keyType,
361+
TypeCombinator::union($this->itemType, $valueType),
364362
);
365363
}
366364

0 commit comments

Comments
 (0)