Skip to content

Commit f76e22c

Browse files
Fix
1 parent 1d76e96 commit f76e22c

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/Type/Constant/ConstantArrayType.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -821,6 +821,9 @@ public function unsetOffset(Type $offsetType): Type
821821
/**
822822
* When we're unsetting something not on the array, it will be untouched,
823823
* So the nextAutoIndexes won't change, and the array might still be a list even with PHPStan definition.
824+
*
825+
* @param list<ConstantIntegerType|ConstantStringType> $newKeyTypes
826+
* @param int[] $newOptionalKeys
824827
*/
825828
private static function isListAfterUnset(array $newKeyTypes, array $newOptionalKeys, TrinaryLogic $arrayIsList, bool $unsetOptionalKey): TrinaryLogic
826829
{

tests/PHPStan/Analyser/NodeScopeResolverTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ class NodeScopeResolverTest extends TypeInferenceTestCase
2727
*/
2828
private static function findTestFiles(): iterable
2929
{
30+
yield __DIR__ . '/nsrt/bug-14177.php';return;
31+
3032
foreach (self::findTestDataFilesFromDirectory(__DIR__ . '/nsrt') as $testFile) {
3133
yield $testFile;
3234
}

0 commit comments

Comments
 (0)