File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
tests/PHPStan/Analyser/nsrt Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -304,9 +304,9 @@ class FooVoidInt {
304304 public function doFoo (): void {
305305 $ this ->foo = $ this ->returnVoid ();
306306 assertType ('null ' , $ this ->foo );
307-
307+
308308 $ this ->fooNonNull = $ this ->returnVoid ();
309- assertType ('null ' , $ this ->foo ); // should be *ERROR*
309+ assertType ('int| null ' , $ this ->foo ); // should be *ERROR*
310310 }
311311
312312 public function returnVoid (): void {
@@ -578,6 +578,16 @@ public function doFoo(array $list): void
578578
579579}
580580
581+ // https://3v4l.org/LJiRB
582+ class CallableString {
583+ private string $ foo ;
584+
585+ public function doFoo (callable $ foo ): void {
586+ $ this ->foo = $ foo ;
587+ assertType ('string ' , $ this ->foo ); // could be non-empty-string
588+ }
589+ }
590+
581591// https://3v4l.org/VvUsp
582592class CallableArray {
583593 private array $ foo ;
You can’t perform that action at this time.
0 commit comments