We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0560ae2 commit 113c7d4Copy full SHA for 113c7d4
tests/PHPStan/Analyser/nsrt/bug-12393b.php
@@ -297,6 +297,24 @@ public function doBar(): void
297
}
298
299
300
+class FooVoidInt {
301
+ private ?int $foo;
302
+ private int $fooNonNull;
303
+
304
+ public function doFoo(): void {
305
+ $this->foo = $this->returnVoid();
306
+ assertType('null', $this->foo);
307
308
+ $this->fooNonNull = $this->returnVoid();
309
+ assertType('null', $this->foo); // should be *ERROR*
310
+ }
311
312
+ public function returnVoid(): void {
313
+ return;
314
315
+}
316
317
318
class FooBoolString
319
{
320
0 commit comments