File tree Expand file tree Collapse file tree 1 file changed +37
-0
lines changed
tests/PHPStan/Analyser/nsrt Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,43 @@ public function sayHelloInline(): void {
2323 }
2424}
2525
26+ abstract class StaticWorld {
27+ abstract public static function getChild (): ?StaticWorld ;
28+
29+ public static function sayHello (): void {
30+ $ foo = null !== static ::getChild ();
31+ if ($ foo ) {
32+ assertType ('Bug5207\StaticWorld ' , static ::getChild ());
33+ }
34+ }
35+
36+ public static function sayHelloInline (): void {
37+ if (null !== static ::getChild ()) {
38+ assertType ('Bug5207\StaticWorld ' , static ::getChild ());
39+ }
40+ }
41+ }
42+
43+ abstract class ImpureStaticWorld {
44+ /**
45+ * @phpstan-impure
46+ */
47+ abstract public static function getChild (): ?ImpureStaticWorld ;
48+
49+ public static function sayHello (): void {
50+ $ foo = null !== static ::getChild ();
51+ if ($ foo ) {
52+ assertType ('Bug5207\ImpureStaticWorld|null ' , static ::getChild ());
53+ }
54+ }
55+
56+ public static function sayHelloInline (): void {
57+ if (null !== static ::getChild ()) {
58+ assertType ('Bug5207\ImpureStaticWorld|null ' , static ::getChild ());
59+ }
60+ }
61+ }
62+
2663abstract class ImpureWorld {
2764 /**
2865 * @phpstan-impure
You can’t perform that action at this time.
0 commit comments