File tree Expand file tree Collapse file tree 3 files changed +20
-0
lines changed
Expand file tree Collapse file tree 3 files changed +20
-0
lines changed Original file line number Diff line number Diff line change 66
77use PHPStan \Type \FloatType ;
88use PHPStan \Type \MixedType ;
9+ use PHPStan \Type \NeverType ;
910use PHPStan \Type \Type ;
1011
1112/** @internal class is only for internal tooling use: do not import it in your own projects */
@@ -17,6 +18,10 @@ public static function isFloat(Type $type): bool
1718 return false ;
1819 }
1920
21+ if ($ type instanceof NeverType) {
22+ return false ;
23+ }
24+
2025 return ! (new FloatType ())->isSuperTypeOf ($ type )->no ();
2126 }
2227}
Original file line number Diff line number Diff line change @@ -22,3 +22,11 @@ function doBar(): string
2222{
2323
2424}
25+
26+ /**
27+ * @return never
28+ */
29+ function withNever ()
30+ {
31+ throw new \RuntimeException ();
32+ }
Original file line number Diff line number Diff line change @@ -26,4 +26,11 @@ public function doBar(): string
2626
2727 }
2828
29+ /**
30+ * @return never
31+ */
32+ public function withNever ()
33+ {
34+ throw new \RuntimeException ();
35+ }
2936}
You can’t perform that action at this time.
0 commit comments