|
@@ -252,6 +252,8 @@ final class TypeExpressionTest extends TestCase
|
|
yield ['array{a: int, b: int, c: int, d: int, e: int, f: int, g: int, h: int, i: int, j: int, with-dash: int}'];
|
|
yield ['array{a: int, b: int, c: int, d: int, e: int, f: int, g: int, h: int, i: int, j: int, with-dash: int}'];
|
|
|
|
|
|
yield ['array{a: int, b: int, c: int, d: int, e: int, f: int, g: int, h: int, i: int, j: int, k: int, l: int, with-dash: int}'];
|
|
yield ['array{a: int, b: int, c: int, d: int, e: int, f: int, g: int, h: int, i: int, j: int, k: int, l: int, with-dash: int}'];
|
|
|
|
+
|
|
|
|
+ yield [self::createHugeArrayShapeType()];
|
|
}
|
|
}
|
|
|
|
|
|
public static function provideGetConstTypesCases(): iterable
|
|
public static function provideGetConstTypesCases(): iterable
|
|
@@ -398,6 +400,8 @@ final class TypeExpressionTest extends TestCase
|
|
yield 'generic Closure with no arguments' => ['Closure<>(): void'];
|
|
yield 'generic Closure with no arguments' => ['Closure<>(): void'];
|
|
|
|
|
|
yield 'generic Closure with non-identifier template argument' => ['Closure<A|B>(): void'];
|
|
yield 'generic Closure with non-identifier template argument' => ['Closure<A|B>(): void'];
|
|
|
|
+
|
|
|
|
+ yield [substr(self::createHugeArrayShapeType(), 0, -1)];
|
|
}
|
|
}
|
|
|
|
|
|
public function testHugeType(): void
|
|
public function testHugeType(): void
|
|
@@ -919,6 +923,20 @@ final class TypeExpressionTest extends TestCase
|
|
];
|
|
];
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ private static function createHugeArrayShapeType(): string
|
|
|
|
+ {
|
|
|
|
+ return sprintf(
|
|
|
|
+ 'array{%s}',
|
|
|
|
+ implode(
|
|
|
|
+ ', ',
|
|
|
|
+ array_map(
|
|
|
|
+ static fn (int $k): string => sprintf('key%sno%d: int', 0 === $k % 2 ? '-' : '_', $k),
|
|
|
|
+ range(1, 1_000),
|
|
|
|
+ ),
|
|
|
|
+ ),
|
|
|
|
+ );
|
|
|
|
+ }
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* Return type is recursive.
|
|
* Return type is recursive.
|
|
*
|
|
*
|