Skip to content

Commit 23295ee

Browse files
committed
fix
1 parent 8a0ccaf commit 23295ee

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

tests/PHPStan/Analyser/nsrt/bug-10640.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88
foreach (toAdd() as $add) {
99
$changes[$add['id']]['add'][] = doSomething($add);
1010
}
11-
assertType('array<int, array{add: non-empty-array<int<0, max>, 1>}>', $changes);
11+
assertType('array<array{add: non-empty-list}>', $changes);
1212

1313
foreach (toRem() as $del) {
1414
$changes[$add['id']]['del'][] = doSomething($del);
1515
}
16-
assertType('array<int, array{add: non-empty-array<int<0, max>, 1>, del?: non-empty-array<int<0, max>, 2>}>', $changes);
16+
assertType('array<non-empty-array{add?: non-empty-list, del?: non-empty-list}>', $changes);
1717

1818
foreach ($changes as $changeSet) {
1919
if (isset($changeSet['del'])) {

tests/PHPStan/Analyser/nsrt/bug-12078.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,11 @@ function main()
5757
]
5858
*/
5959

60-
assertType("array<non-empty-array{'6M'?: non-empty-list<string>, '3M'?: non-empty-list<string>}>", $arrDataByKey);
60+
assertType("array<string, non-empty-array{'6M'?: non-empty-list<string>, '3M'?: non-empty-list<string>}>", $arrDataByKey);
6161
foreach ($arrDataByKey as $key => $arrDataByKeyForKey) {
62-
assertType("array<non-empty-array{'6M'?: non-empty-list<string>, '3M'?: non-empty-list<string>}>", $arrDataByKeyForKey);
62+
assertType("non-empty-array{'6M'?: non-empty-list<string>, '3M'?: non-empty-list<string>}", $arrDataByKeyForKey);
6363
echo [] === ($arrDataByKeyForKey['6M'] ?? []) ? 'No 6M data for key ' . $key . "\n" : 'We got 6M data for key ' . $key . "\n";
6464
echo [] === ($arrDataByKeyForKey['3M'] ?? []) ? 'No 3M data for key ' . $key . "\n" : 'We got 3M data for key ' . $key . "\n";
65-
assertType("array<non-empty-array{'6M'?: non-empty-list<string>, '3M'?: non-empty-list<string>}>", $arrDataByKeyForKey);
65+
assertType("non-empty-array{'6M'?: non-empty-list<string>, '3M'?: non-empty-list<string>}", $arrDataByKeyForKey);
6666
}
6767
}

tests/PHPStan/Analyser/nsrt/bug-8270.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ function (): void {
1313
'value' => rand(),
1414
];
1515
}
16-
assertType('list<array{test: false, value: int<0, max>}>', $list);
16+
assertType('non-empty-list<array{test: false, value: int<0, max>}>', $list);
1717

1818
// TODO: sort list by value asc...
1919
$k = array_key_first($list);
@@ -24,6 +24,6 @@ function (): void {
2424
echo $item['value'];
2525
}
2626
}
27-
assertType('array{test: true, value?: int<0, max>}', $list);
27+
assertType('non-empty-list<array{test: bool, value: int<0, max>}>&hasOffsetValue(0, array{test: true, value: int<0, max>})', $list);
2828

2929
};

0 commit comments

Comments
 (0)