22
33namespace PHPStan \Rules \Traits ;
44
5- use PHPStan \Php \PhpVersion ;
65use PHPStan \Rules \AttributesCheck ;
76use PHPStan \Rules \ClassCaseSensitivityCheck ;
87use PHPStan \Rules \ClassForbiddenNameCheck ;
@@ -35,7 +34,6 @@ protected function getRule(): Rule
3534 new FunctionCallParametersCheck (
3635 new RuleLevelHelper ($ reflectionProvider , true , false , true , $ this ->checkExplicitMixed , $ this ->checkImplicitMixed , false ),
3736 new NullsafeCheck (),
38- new PhpVersion (80000 ),
3937 new UnresolvableTypeHelper (),
4038 new PropertyReflectionFinder (),
4139 true ,
@@ -54,6 +52,10 @@ protected function getRule(): Rule
5452
5553 public function testRule (): void
5654 {
55+ if (PHP_VERSION_ID < 80000 ) {
56+ $ this ->markTestSkipped ('Test requires PHP 8.0. ' );
57+ }
58+
5759 $ this ->analyse ([__DIR__ . '/data/trait-attributes.php ' ], [
5860 [
5961 'Attribute class TraitAttributes\AbstractAttribute is abstract. ' ,
@@ -85,6 +87,10 @@ public function testBug12011(): void
8587
8688 public function testBug12281 (): void
8789 {
90+ if (PHP_VERSION_ID < 80100 ) {
91+ $ this ->markTestSkipped ('Test requires PHP 8.1. ' );
92+ }
93+
8894 $ this ->analyse ([__DIR__ . '/data/bug-12281.php ' ], [
8995 [
9096 'Attribute class AllowDynamicProperties cannot be used with trait. ' ,
0 commit comments