Skip to content

Commit 0807b5e

Browse files
committed
assertions
1 parent a45d440 commit 0807b5e

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

tests/PHPStan/Analyser/data/bug-14324.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
namespace Bug14324;
44

5+
use function PHPStan\Testing\assertType;
6+
57
final class Test
68
{
79
private const ADDITIONAL_MAPS = [
@@ -48,11 +50,14 @@ public function createMap(): void
4850
'bar2' => static fn() => 'bar2',
4951
'baz2' => static fn() => 'baz2',
5052
];
53+
assertType("array{foo: Closure(): 'foo', bar: Closure(): 'bar', baz: Closure(): 'baz', qux: Closure(): 'qux', quux: Closure(): 'quux', corge: Closure(): 'corge', grault: Closure(): 'grault', garply: Closure(): 'garply', waldo: Closure(): 'waldo', fred: Closure(): 'fred', plugh: Closure(): 'plugh', xyzzy: Closure(): 'xyzzy', thud: Closure(): 'thud', foo1: Closure(): 'foo1', bar1: Closure(): 'bar1', baz1: Closure(): 'baz1', qux1: Closure(): 'qux1', quux1: Closure(): 'quux1', corge1: Closure(): 'corge1', grault1: Closure(): 'grault1', garply1: Closure(): 'garply1', waldo1: Closure(): 'waldo1', fred1: Closure(): 'fred1', plugh1: Closure(): 'plugh1', xyzzy1: Closure(): 'xyzzy1', thud1: Closure(): 'thud1', foo2: Closure(): 'foo2', bar2: Closure(): 'bar2', baz2: Closure(): 'baz2'}", self::$map);
5154

5255
foreach (self::ADDITIONAL_MAPS as $map) {
5356
// added with 3 entries, breaching the closure limit of 32 entries
5457
self::$map[$map] = fn () => self::$map['foo']();
5558
}
59+
60+
assertType("non-empty-array<'bar'|'bar-'|'bar1'|'bar2'|'baz'|'baz-'|'baz1'|'baz2'|'corge'|'corge1'|'foo'|'foo-'|'foo1'|'foo2'|'fred'|'fred1'|'garply'|'garply1'|'grault'|'grault1'|'plugh'|'plugh1'|'quux'|'quux1'|'qux'|'qux1'|'thud'|'thud1'|'waldo'|'waldo1'|'xyzzy'|'xyzzy1', callable(): mixed>&oversized-array", self::$map);
5661
}
5762
}
5863
}

0 commit comments

Comments
 (0)