We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent beab3d7 commit 45e5b4aCopy full SHA for 45e5b4a
tests/PHPStan/Analyser/nsrt/bug-5207b.php
@@ -0,0 +1,20 @@
1
+<?php // lint >= 8.0
2
+
3
+declare(strict_types = 1);
4
5
+namespace Bug5207b;
6
7
+use function PHPStan\Testing\assertType;
8
9
+abstract class HelloWorld {
10
+ abstract public function getChild(): ?HelloWorld;
11
12
+ public function sayHello(): void {
13
+ $foo = null !== $this->getChild()->getChild();
14
+ if ($foo) {
15
+ assertType('Bug5207\HelloWorld', $this->getChild());
16
+ assertType('Bug5207\HelloWorld', $this->getChild()->getChild());
17
+ assertType('Bug5207b\HelloWorld|null', $this->getChild()->getChild()->getChild());
18
+ }
19
20
+}
0 commit comments