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 @@ -2930,8 +2930,7 @@ static function (): void {
29302930 $ exprResult ->getThrowPoints (),
29312931 $ exprResult ->getImpurePoints (),
29322932 static fn (): MutatingScope => $ scope ->filterByTruthyValue ($ expr ),
2933- static fn (): MutatingScope => $ scope ->filterByFalseyValue ($ expr ),
2934- $ exprResult ->isAlwaysTerminating (),
2933+ static fn (): MutatingScope => $ scope ->filterByFalseyValue ($ expr )
29352934 );
29362935 } elseif ($ expr instanceof StaticCall) {
29372936 $ 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