File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed
tests/PHPStan/Rules/DeadCode/data Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -2929,8 +2929,7 @@ static function (): void {
2929
2929
$ exprResult ->getThrowPoints (),
2930
2930
$ exprResult ->getImpurePoints (),
2931
2931
static fn (): MutatingScope => $ scope ->filterByTruthyValue ($ expr ),
2932
- static fn (): MutatingScope => $ scope ->filterByFalseyValue ($ expr ),
2933
- $ exprResult ->isAlwaysTerminating (),
2932
+ static fn (): MutatingScope => $ scope ->filterByFalseyValue ($ expr )
2934
2933
);
2935
2934
} elseif ($ expr instanceof StaticCall) {
2936
2935
$ hasYield = false ;
Original file line number Diff line number Diff line change @@ -20,6 +20,14 @@ static public function sayStaticHello(): void
20
20
echo 'this will never happen ' ;
21
21
}
22
22
23
+ public function sayNullsafeHello (?self $ x ): void
24
+ {
25
+ echo 'Hello, ' . $ x ?->mightReturnNever()
26
+ . ' no way ' ;
27
+
28
+ echo 'this might happen, in case $x is null ' ;
29
+ }
30
+
23
31
function mightReturnNever (): never
24
32
25
33
{
You can’t perform that action at this time.
0 commit comments