Skip to content

Commit b9d204d

Browse files
Fix tests
1 parent 749303d commit b9d204d

File tree

1 file changed

+20
-22
lines changed

1 file changed

+20
-22
lines changed

tests/PHPStan/Type/TypeToPhpDocNodeTest.php

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,8 @@ public static function dataToPhpDocNode(): iterable
369369
]),
370370
'non-empty-array<mixed>',
371371
];
372-
$constantArrayWithOptionalKeys = new ConstantArrayType([
372+
373+
$listWithOptionalKeys = new ConstantArrayType([
373374
new ConstantIntegerType(0),
374375
new ConstantIntegerType(1),
375376
new ConstantIntegerType(2),
@@ -379,25 +380,14 @@ public static function dataToPhpDocNode(): iterable
379380
new StringType(),
380381
new StringType(),
381382
new StringType(),
382-
], [3], [2, 3], TrinaryLogic::createMaybe());
383-
384-
yield [
385-
new IntersectionType([
386-
$constantArrayWithOptionalKeys,
387-
new AccessoryArrayListType(),
388-
]),
389-
'list{0: string, 1: string, 2?: string, 3?: string}',
390-
];
383+
], [3], [2, 3], TrinaryLogic::createYes());
391384

392385
yield [
393-
new IntersectionType([
394-
$constantArrayWithOptionalKeys,
395-
new AccessoryArrayListType(),
396-
]),
386+
$listWithOptionalKeys,
397387
'list{0: string, 1: string, 2?: string, 3?: string}',
398388
];
399389

400-
$constantArrayWithAllOptionalKeys = new ConstantArrayType([
390+
$listArrayWithAllOptionalKeys = new ConstantArrayType([
401391
new ConstantIntegerType(0),
402392
new ConstantIntegerType(1),
403393
new ConstantIntegerType(2),
@@ -407,25 +397,33 @@ public static function dataToPhpDocNode(): iterable
407397
new StringType(),
408398
new StringType(),
409399
new StringType(),
410-
], [3], [0, 1, 2, 3], TrinaryLogic::createMaybe());
400+
], [3], [0, 1, 2, 3], TrinaryLogic::createYes());
411401

412402
yield [
413-
new IntersectionType([
414-
$constantArrayWithAllOptionalKeys,
415-
new AccessoryArrayListType(),
416-
]),
403+
$listArrayWithAllOptionalKeys,
417404
'list{0?: string, 1?: string, 2?: string, 3?: string}',
418405
];
419406

420407
yield [
421408
new IntersectionType([
422-
$constantArrayWithAllOptionalKeys,
409+
$listArrayWithAllOptionalKeys,
423410
new NonEmptyArrayType(),
424-
new AccessoryArrayListType(),
425411
]),
426412
'non-empty-list{0?: string, 1?: string, 2?: string, 3?: string}',
427413
];
428414

415+
$constantArrayWithAllOptionalKeys = new ConstantArrayType([
416+
new ConstantIntegerType(0),
417+
new ConstantIntegerType(1),
418+
new ConstantIntegerType(2),
419+
new ConstantIntegerType(3),
420+
], [
421+
new StringType(),
422+
new StringType(),
423+
new StringType(),
424+
new StringType(),
425+
], [3], [0, 1, 2, 3], TrinaryLogic::createMaybe());
426+
429427
yield [
430428
new IntersectionType([
431429
$constantArrayWithAllOptionalKeys,

0 commit comments

Comments
 (0)