2
2
3
3
namespace PHPStan \Rules \Traits ;
4
4
5
- use PHPStan \Php \PhpVersion ;
6
5
use PHPStan \Rules \AttributesCheck ;
7
6
use PHPStan \Rules \ClassCaseSensitivityCheck ;
8
7
use PHPStan \Rules \ClassForbiddenNameCheck ;
@@ -35,7 +34,6 @@ protected function getRule(): Rule
35
34
new FunctionCallParametersCheck (
36
35
new RuleLevelHelper ($ reflectionProvider , true , false , true , $ this ->checkExplicitMixed , $ this ->checkImplicitMixed , false ),
37
36
new NullsafeCheck (),
38
- new PhpVersion (80000 ),
39
37
new UnresolvableTypeHelper (),
40
38
new PropertyReflectionFinder (),
41
39
true ,
@@ -54,6 +52,10 @@ protected function getRule(): Rule
54
52
55
53
public function testRule (): void
56
54
{
55
+ if (PHP_VERSION_ID < 80000 ) {
56
+ $ this ->markTestSkipped ('Test requires PHP 8.0. ' );
57
+ }
58
+
57
59
$ this ->analyse ([__DIR__ . '/data/trait-attributes.php ' ], [
58
60
[
59
61
'Attribute class TraitAttributes\AbstractAttribute is abstract. ' ,
@@ -85,6 +87,10 @@ public function testBug12011(): void
85
87
86
88
public function testBug12281 (): void
87
89
{
90
+ if (PHP_VERSION_ID < 80100 ) {
91
+ $ this ->markTestSkipped ('Test requires PHP 8.1. ' );
92
+ }
93
+
88
94
$ this ->analyse ([__DIR__ . '/data/bug-12281.php ' ], [
89
95
[
90
96
'Attribute class AllowDynamicProperties cannot be used with trait. ' ,
0 commit comments