Skip to content

Commit d31a409

Browse files
committed
simplify
1 parent e0b0599 commit d31a409

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

src/Rules/PHPUnit/PHPUnitVersionDetector.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313
class PHPUnitVersionDetector
1414
{
1515

16-
private ?PHPUnitVersion $PHPUnitVersion = null;
17-
1816
private ReflectionProvider $reflectionProvider;
1917

2018
public function __construct(ReflectionProvider $reflectionProvider)
@@ -24,10 +22,6 @@ public function __construct(ReflectionProvider $reflectionProvider)
2422

2523
public function create(): PHPUnitVersion
2624
{
27-
if ($this->PHPUnitVersion !== null) {
28-
return $this->PHPUnitVersion;
29-
}
30-
3125
$majorVersion = null;
3226
if ($this->reflectionProvider->hasClass(TestCase::class)) {
3327
$testCase = $this->reflectionProvider->getClass(TestCase::class);
@@ -48,7 +42,7 @@ public function create(): PHPUnitVersion
4842
}
4943
}
5044

51-
return $this->PHPUnitVersion = new PHPUnitVersion($majorVersion);
45+
return new PHPUnitVersion($majorVersion);
5246
}
5347

5448
}

0 commit comments

Comments
 (0)