Skip to content

Commit a355076

Browse files
Fix
1 parent 8df03dc commit a355076

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Type/Constant/ConstantArrayType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1598,7 +1598,7 @@ private function shouldBeDescribedAsAList(): bool
15981598
return false;
15991599
}
16001600

1601-
if (count($this->optionalKeys) === 2) {
1601+
if (count($this->optionalKeys) > 1) {
16021602
return true;
16031603
}
16041604

tests/PHPStan/Analyser/nsrt/array-chunk.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public function lengthIntRanges(array $arr, int $positiveInt, int $bigger50) {
7070
*/
7171
function testLimits(array $arr, int $oneToFour, int $tooBig) {
7272
/** @var array{a: 0, b?: 1, c: 2, d: 3} $arr */
73-
assertType('array{0: array{0: 0, 1?: 1|2, 2?: 2|3, 3?: 3}, 1?: list{0?: 2|3, 1?: 3}}|array{array{0}, list{0?: 1|2, 1?: 2}, list{0?: 2|3, 1?: 3}, array{0?: 3}}', array_chunk($arr, $oneToFour));
73+
assertType('array{0: list{0: 0, 1?: 1|2, 2?: 2|3, 3?: 3}, 1?: list{0?: 2|3, 1?: 3}}|array{array{0}, list{0?: 1|2, 1?: 2}, list{0?: 2|3, 1?: 3}, array{0?: 3}}', array_chunk($arr, $oneToFour));
7474
assertType('non-empty-list<non-empty-list<0|1|2|3>>', array_chunk($arr, $tooBig));
7575
}
7676

0 commit comments

Comments
 (0)