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 {
29322932$ exprResult ->getThrowPoints (),
29332933$ exprResult ->getImpurePoints (),
29342934static fn (): MutatingScope => $ scope ->filterByTruthyValue ($ expr ),
2935- static fn (): MutatingScope => $ scope ->filterByFalseyValue ($ expr ),
2936- $ exprResult ->isAlwaysTerminating (),
2935+ static fn (): MutatingScope => $ scope ->filterByFalseyValue ($ expr )
29372936);
29382937} elseif ($ expr instanceof StaticCall) {
29392938$ hasYield = false ;
Original file line number Diff line number Diff line change @@ -20,6 +20,14 @@ static public function sayStaticHello(): void
2020echo '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+
2331function mightReturnNever (): never
2432
2533{
You can’t perform that action at this time.
0 commit comments