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 {
29292929 $ exprResult ->getThrowPoints (),
29302930 $ exprResult ->getImpurePoints (),
29312931 static fn (): MutatingScope => $ scope ->filterByTruthyValue ($ expr ),
2932- static fn (): MutatingScope => $ scope ->filterByFalseyValue ($ expr ),
2933- $ exprResult ->isAlwaysTerminating (),
2932+ static fn (): MutatingScope => $ scope ->filterByFalseyValue ($ expr )
29342933 );
29352934 } elseif ($ expr instanceof StaticCall) {
29362935 $ hasYield = false ;
Original file line number Diff line number Diff line change @@ -20,6 +20,14 @@ static public function sayStaticHello(): void
2020 echo 'this will never happen ' ;
2121 }
2222
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+
2331 function mightReturnNever (): never
2432
2533 {
You can’t perform that action at this time.
0 commit comments