File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
tests/PHPStan/Rules/DeadCode Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -2930,7 +2930,7 @@ static function (): void {
2930
2930
$ exprResult ->getImpurePoints (),
2931
2931
static fn (): MutatingScope => $ scope ->filterByTruthyValue ($ expr ),
2932
2932
static fn (): MutatingScope => $ scope ->filterByFalseyValue ($ expr ),
2933
- $ exprResult ->isAlwaysTerminating ()
2933
+ $ exprResult ->isAlwaysTerminating (),
2934
2934
);
2935
2935
} elseif ($ expr instanceof StaticCall) {
2936
2936
$ hasYield = false ;
@@ -5801,7 +5801,7 @@ static function (): void {
5801
5801
$ hasYield = $ result ->hasYield ();
5802
5802
$ throwPoints = array_merge ($ throwPoints , $ result ->getThrowPoints ());
5803
5803
$ impurePoints = array_merge ($ impurePoints , $ result ->getImpurePoints ());
5804
- $ isAlwaysTerminating = $ isAlwaysTerminating || $ result ->isAlwaysTerminating ();
5804
+ $ isAlwaysTerminating = $ result ->isAlwaysTerminating ();
5805
5805
$ scope = $ result ->getScope ();
5806
5806
foreach ($ var ->items as $ i => $ arrayItem ) {
5807
5807
if ($ arrayItem === null ) {
Original file line number Diff line number Diff line change 5
5
use PHPStan \Rules \Rule ;
6
6
use PHPStan \Testing \RuleTestCase ;
7
7
use PHPUnit \Framework \Attributes \DataProvider ;
8
+ use PHPUnit \Framework \Attributes \RequiresPhp ;
8
9
9
10
/**
10
11
* @extends RuleTestCase<UnreachableStatementRule>
@@ -240,6 +241,7 @@ public function testMultipleUnreachable(): void
240
241
]);
241
242
}
242
243
244
+ #[RequiresPhp('>= 8.1 ' )]
243
245
public function testBug13232a (): void
244
246
{
245
247
$ this ->treatPhpDocTypesAsCertain = false ;
@@ -251,6 +253,7 @@ public function testBug13232a(): void
251
253
]);
252
254
}
253
255
256
+ #[RequiresPhp('>= 8.1 ' )]
254
257
public function testBug13232b (): void
255
258
{
256
259
$ this ->treatPhpDocTypesAsCertain = false ;
@@ -262,6 +265,7 @@ public function testBug13232b(): void
262
265
]);
263
266
}
264
267
268
+ #[RequiresPhp('>= 8.1 ' )]
265
269
public function testBug13232c (): void
266
270
{
267
271
$ this ->treatPhpDocTypesAsCertain = false ;
@@ -277,6 +281,7 @@ public function testBug13232c(): void
277
281
]);
278
282
}
279
283
284
+ #[RequiresPhp('>= 8.1 ' )]
280
285
public function testBug13232d (): void
281
286
{
282
287
$ this ->treatPhpDocTypesAsCertain = false ;
You can’t perform that action at this time.
0 commit comments