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 @@ -2932,8 +2932,7 @@ static function (): void {
2932
2932
$ exprResult ->getThrowPoints (),
2933
2933
$ exprResult ->getImpurePoints (),
2934
2934
static fn (): MutatingScope => $ scope ->filterByTruthyValue ($ expr ),
2935
- static fn (): MutatingScope => $ scope ->filterByFalseyValue ($ expr ),
2936
- $ exprResult ->isAlwaysTerminating (),
2935
+ static fn (): MutatingScope => $ scope ->filterByFalseyValue ($ expr )
2937
2936
);
2938
2937
} elseif ($ expr instanceof StaticCall) {
2939
2938
$ 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