Skip to content

Commit 0560ae2

Browse files
committed
suport callable arrays
1 parent 9d19f30 commit 0560ae2

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tests/PHPStan/Analyser/nsrt/bug-12393b.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -560,6 +560,16 @@ public function doFoo(array $list): void
560560

561561
}
562562

563+
// https://3v4l.org/VvUsp
564+
class CallableArray {
565+
private array $foo;
566+
567+
public function doFoo(callable $foo): void {
568+
$this->foo = $foo;
569+
assertType('array', $this->foo); // could be non-empty-array
570+
}
571+
}
572+
563573
class StringableFoo {
564574
private string $foo;
565575

@@ -585,3 +595,4 @@ public function __toString(): string {
585595
return 'Foo';
586596
}
587597
}
598+

0 commit comments

Comments
 (0)