diff --git a/build/PHPStan/Build/RequiredPhpVersionVisitor.php b/build/PHPStan/Build/RequiredPhpVersionVisitor.php new file mode 100644 index 00000000000..3103d6f725d --- /dev/null +++ b/build/PHPStan/Build/RequiredPhpVersionVisitor.php @@ -0,0 +1,190 @@ += X.Y` comment so they get skipped on older PHP versions + * in CI instead of producing a hard parse error. + */ +final class RequiredPhpVersionVisitor extends NodeVisitorAbstract +{ + + public const PHP_8_0 = 80000; + + private const PHP_8_1 = 80100; + private const PHP_8_2 = 80200; + private const PHP_8_3 = 80300; + private const PHP_8_4 = 80400; + private const PHP_8_5 = 80500; + + private ?int $requiredVersionId = null; + + private ?string $reason = null; + + private ?int $reasonLine = null; + + public function getRequiredVersionId(): ?int + { + return $this->requiredVersionId; + } + + public function getReason(): ?string + { + return $this->reason; + } + + public function getReasonLine(): ?int + { + return $this->reasonLine; + } + + #[Override] + public function enterNode(Node $node): ?Node + { + if ($node instanceof Node\Stmt\Enum_) { + $this->require(self::PHP_8_1, 'enums', $node); + } + + if ($node instanceof Node\Expr\BinaryOp\Pipe) { + $this->require(self::PHP_8_5, 'the pipe operator', $node); + } + + if ($node instanceof Node\PropertyHook) { + $this->require(self::PHP_8_4, 'property hooks', $node); + } + + if ($node instanceof Node\IntersectionType) { + $this->require(self::PHP_8_1, 'pure intersection types', $node); + } + + if ($node instanceof Node\UnionType) { + foreach ($node->types as $innerType) { + if ($innerType instanceof Node\IntersectionType) { + $this->require(self::PHP_8_2, 'disjunctive normal form types', $innerType); + } + if (!($innerType instanceof Node\Identifier) || strtolower($innerType->name) !== 'true') { + continue; + } + + $this->require(self::PHP_8_2, 'the standalone "true" type', $innerType); + } + } + + if ($node instanceof Node\Stmt\Class_ && ($node->flags & Modifiers::READONLY) !== 0) { + $this->require(self::PHP_8_2, 'readonly classes', $node); + } + + if ($node instanceof Node\Stmt\Property && ($node->flags & Modifiers::READONLY) !== 0) { + $this->require(self::PHP_8_1, 'readonly properties', $node); + } + + if ($node instanceof Node\Param && ($node->flags & Modifiers::READONLY) !== 0) { + $this->require(self::PHP_8_1, 'readonly promoted properties', $node); + } + + if ( + ($node instanceof Node\Param || $node instanceof Node\Stmt\Property) + && ($node->flags & Modifiers::VISIBILITY_SET_MASK) !== 0 + ) { + $this->require(self::PHP_8_4, 'asymmetric visibility', $node); + } + + if ($node instanceof Node\Stmt\ClassConst && $node->type !== null) { + $this->require(self::PHP_8_3, 'typed class constants', $node); + } + + if ($node instanceof Node\Expr\ClassConstFetch && $node->name instanceof Node\Expr) { + $this->require(self::PHP_8_3, 'dynamic class constant fetch', $node); + } + + if ( + $node instanceof Node\Expr\FuncCall + || $node instanceof Node\Expr\MethodCall + || $node instanceof Node\Expr\NullsafeMethodCall + || $node instanceof Node\Expr\StaticCall + ) { + foreach ($node->args as $arg) { + if ($arg instanceof Node\VariadicPlaceholder) { + $this->require(self::PHP_8_1, 'first-class callable syntax', $arg); + break; + } + } + } + + $this->checkStandaloneType($node); + $this->checkMixedType($node); + + return null; + } + + private function checkStandaloneType(Node $node): void + { + $type = $this->getDeclaredType($node); + if (!$type instanceof Node\Identifier) { + return; + } + + if (!in_array(strtolower($type->name), ['null', 'false', 'true'], true)) { + return; + } + + $this->require(self::PHP_8_2, 'standalone "null", "false" or "true" types', $type); + } + + private function checkMixedType(Node $node): void + { + $type = $this->getDeclaredType($node); + if (!$type instanceof Node\Identifier) { + return; + } + + if (strtolower($type->name) !== 'mixed') { + return; + } + + $this->require(self::PHP_8_0, 'the mixed type', $type); + } + + private function getDeclaredType(Node $node): ?Node + { + if ( + $node instanceof Node\Param + || $node instanceof Node\Stmt\Property + || $node instanceof Node\Stmt\ClassConst + ) { + return $node->type; + } + + if ( + $node instanceof Node\Stmt\Function_ + || $node instanceof Node\Stmt\ClassMethod + || $node instanceof Node\Expr\Closure + || $node instanceof Node\Expr\ArrowFunction + ) { + return $node->returnType; + } + + return null; + } + + private function require(int $versionId, string $reason, Node $node): void + { + if ($this->requiredVersionId !== null && $this->requiredVersionId >= $versionId) { + return; + } + + $this->requiredVersionId = $versionId; + $this->reason = $reason; + $this->reasonLine = $node->getStartLine(); + } + +} diff --git a/tests/PHPStan/Analyser/data/bug-10049-recursive.php b/tests/PHPStan/Analyser/data/bug-10049-recursive.php index b0887157bac..070969d6391 100644 --- a/tests/PHPStan/Analyser/data/bug-10049-recursive.php +++ b/tests/PHPStan/Analyser/data/bug-10049-recursive.php @@ -1,4 +1,4 @@ -= 8.1 namespace Bug10049Recursive; diff --git a/tests/PHPStan/Analyser/data/bug-10847.php b/tests/PHPStan/Analyser/data/bug-10847.php index 6a3dd0bbb0c..89ac5861146 100644 --- a/tests/PHPStan/Analyser/data/bug-10847.php +++ b/tests/PHPStan/Analyser/data/bug-10847.php @@ -1,4 +1,4 @@ -= 8.1 namespace Bug10847; diff --git a/tests/PHPStan/Analyser/data/bug-11147.php b/tests/PHPStan/Analyser/data/bug-11147.php index 87ef8ebe369..ca8422bd198 100644 --- a/tests/PHPStan/Analyser/data/bug-11147.php +++ b/tests/PHPStan/Analyser/data/bug-11147.php @@ -1,4 +1,4 @@ -= 8.0 declare(strict_types=1); diff --git a/tests/PHPStan/Analyser/data/bug-11709.php b/tests/PHPStan/Analyser/data/bug-11709.php index 2515e3dcb82..6e6c34eb6cd 100644 --- a/tests/PHPStan/Analyser/data/bug-11709.php +++ b/tests/PHPStan/Analyser/data/bug-11709.php @@ -1,4 +1,4 @@ -= 8.0 namespace Bug11709; diff --git a/tests/PHPStan/Analyser/data/bug-12246.php b/tests/PHPStan/Analyser/data/bug-12246.php index 9bf1cf7cd64..dd4db6cb9f9 100644 --- a/tests/PHPStan/Analyser/data/bug-12246.php +++ b/tests/PHPStan/Analyser/data/bug-12246.php @@ -1,4 +1,4 @@ -= 8.1 namespace Bug12246; diff --git a/tests/PHPStan/Analyser/data/bug-12549.php b/tests/PHPStan/Analyser/data/bug-12549.php index e1bd8c5f0c5..59f48047452 100644 --- a/tests/PHPStan/Analyser/data/bug-12549.php +++ b/tests/PHPStan/Analyser/data/bug-12549.php @@ -1,4 +1,4 @@ -= 8.3 namespace Bug12549; diff --git a/tests/PHPStan/Analyser/data/bug-12949.php b/tests/PHPStan/Analyser/data/bug-12949.php index eeafccb0de2..6433ec26934 100644 --- a/tests/PHPStan/Analyser/data/bug-12949.php +++ b/tests/PHPStan/Analyser/data/bug-12949.php @@ -1,4 +1,4 @@ -= 8.3 namespace Bug12949; diff --git a/tests/PHPStan/Analyser/data/bug-14501.php b/tests/PHPStan/Analyser/data/bug-14501.php index b9aaa50c2eb..afe43008856 100644 --- a/tests/PHPStan/Analyser/data/bug-14501.php +++ b/tests/PHPStan/Analyser/data/bug-14501.php @@ -1,4 +1,4 @@ -= 8.3 namespace Bug14501; diff --git a/tests/PHPStan/Analyser/data/bug-14542.php b/tests/PHPStan/Analyser/data/bug-14542.php index e24bdfd194f..1d4f6568b23 100644 --- a/tests/PHPStan/Analyser/data/bug-14542.php +++ b/tests/PHPStan/Analyser/data/bug-14542.php @@ -1,4 +1,4 @@ -= 8.0 namespace Bug14542; diff --git a/tests/PHPStan/Analyser/data/bug-7927.php b/tests/PHPStan/Analyser/data/bug-7927.php index b5ed5d572c0..69c1f0b772c 100644 --- a/tests/PHPStan/Analyser/data/bug-7927.php +++ b/tests/PHPStan/Analyser/data/bug-7927.php @@ -1,4 +1,4 @@ -= 8.1 namespace Bug7927; diff --git a/tests/PHPStan/Analyser/data/bug-7980.php b/tests/PHPStan/Analyser/data/bug-7980.php index 1e2f3c06010..c29f7b4a8c1 100644 --- a/tests/PHPStan/Analyser/data/bug-7980.php +++ b/tests/PHPStan/Analyser/data/bug-7980.php @@ -1,4 +1,4 @@ -= 8.1 namespace Bug7980; diff --git a/tests/PHPStan/Analyser/data/bug-8072.php b/tests/PHPStan/Analyser/data/bug-8072.php index 2f9b8810572..61a8600cf91 100644 --- a/tests/PHPStan/Analyser/data/bug-8072.php +++ b/tests/PHPStan/Analyser/data/bug-8072.php @@ -1,4 +1,4 @@ -= 8.1 namespace Bug8072; diff --git a/tests/PHPStan/Analyser/data/immediately-called-function-without-implicit-throw.php b/tests/PHPStan/Analyser/data/immediately-called-function-without-implicit-throw.php index 6b2c380923d..7971a0e44e8 100644 --- a/tests/PHPStan/Analyser/data/immediately-called-function-without-implicit-throw.php +++ b/tests/PHPStan/Analyser/data/immediately-called-function-without-implicit-throw.php @@ -1,4 +1,4 @@ -= 8.1 namespace ImmediatelyCalledFunctionWithoutImplicitThrow; diff --git a/tests/PHPStan/Analyser/data/param-out.php b/tests/PHPStan/Analyser/data/param-out.php index 3eed881843e..ebd668effd4 100644 --- a/tests/PHPStan/Analyser/data/param-out.php +++ b/tests/PHPStan/Analyser/data/param-out.php @@ -1,4 +1,4 @@ -= 8.0 namespace ParamOut; diff --git a/tests/PHPStan/Analyser/data/scope-in-enum-match-arm-body.php b/tests/PHPStan/Analyser/data/scope-in-enum-match-arm-body.php index a46af9b5304..af39853b579 100644 --- a/tests/PHPStan/Analyser/data/scope-in-enum-match-arm-body.php +++ b/tests/PHPStan/Analyser/data/scope-in-enum-match-arm-body.php @@ -1,4 +1,4 @@ -= 8.1 namespace ScopeInEnumMatchArmBody; diff --git a/tests/PHPStan/Analyser/data/unknown-mixed-type.php b/tests/PHPStan/Analyser/data/unknown-mixed-type.php index d603b6d3efe..e3cf82ec209 100644 --- a/tests/PHPStan/Analyser/data/unknown-mixed-type.php +++ b/tests/PHPStan/Analyser/data/unknown-mixed-type.php @@ -1,4 +1,4 @@ -= 8.0 namespace UnknownMixedType; diff --git a/tests/PHPStan/Analyser/nsrt/array-key-exists-on-subtracted.php b/tests/PHPStan/Analyser/nsrt/array-key-exists-on-subtracted.php index 2261e3afa30..0c2acc7634c 100644 --- a/tests/PHPStan/Analyser/nsrt/array-key-exists-on-subtracted.php +++ b/tests/PHPStan/Analyser/nsrt/array-key-exists-on-subtracted.php @@ -1,4 +1,4 @@ -= 8.0 += 8.1 namespace ArrayKeyExistsSubtracted; diff --git a/tests/PHPStan/Analyser/nsrt/array-map.php b/tests/PHPStan/Analyser/nsrt/array-map.php index b085e88ed4f..5acfd1ab7a4 100644 --- a/tests/PHPStan/Analyser/nsrt/array-map.php +++ b/tests/PHPStan/Analyser/nsrt/array-map.php @@ -1,5 +1,4 @@ -= 8.1 namespace ArrayMap; use function array_map; diff --git a/tests/PHPStan/Analyser/nsrt/array_values.php b/tests/PHPStan/Analyser/nsrt/array_values.php index 16f22215d84..70e3666ec50 100644 --- a/tests/PHPStan/Analyser/nsrt/array_values.php +++ b/tests/PHPStan/Analyser/nsrt/array_values.php @@ -1,4 +1,4 @@ -= 8.0 += 8.1 namespace ArrayValues; diff --git a/tests/PHPStan/Analyser/nsrt/bug-10037.php b/tests/PHPStan/Analyser/nsrt/bug-10037.php index 56c49c331bd..9ac7f422b44 100644 --- a/tests/PHPStan/Analyser/nsrt/bug-10037.php +++ b/tests/PHPStan/Analyser/nsrt/bug-10037.php @@ -1,4 +1,4 @@ -= 8.0 += 8.2 declare(strict_types = 1); diff --git a/tests/PHPStan/Analyser/nsrt/bug-10477.php b/tests/PHPStan/Analyser/nsrt/bug-10477.php index c97672bf98b..6703cfdfc00 100644 --- a/tests/PHPStan/Analyser/nsrt/bug-10477.php +++ b/tests/PHPStan/Analyser/nsrt/bug-10477.php @@ -1,4 +1,4 @@ -= 8.0 namespace Bug10477; diff --git a/tests/PHPStan/Analyser/nsrt/bug-11899.php b/tests/PHPStan/Analyser/nsrt/bug-11899.php index c56b47dfcb8..76505647f17 100644 --- a/tests/PHPStan/Analyser/nsrt/bug-11899.php +++ b/tests/PHPStan/Analyser/nsrt/bug-11899.php @@ -1,4 +1,4 @@ -= 8.0 namespace Bug11899; diff --git a/tests/PHPStan/Analyser/nsrt/bug-12691.php b/tests/PHPStan/Analyser/nsrt/bug-12691.php index 44246463faf..af06944bf34 100644 --- a/tests/PHPStan/Analyser/nsrt/bug-12691.php +++ b/tests/PHPStan/Analyser/nsrt/bug-12691.php @@ -1,4 +1,6 @@ -= 8.1 + +declare(strict_types = 1); namespace Bug12691; diff --git a/tests/PHPStan/Analyser/nsrt/bug-13061.php b/tests/PHPStan/Analyser/nsrt/bug-13061.php index 0f494d1481c..5c31d3787b8 100644 --- a/tests/PHPStan/Analyser/nsrt/bug-13061.php +++ b/tests/PHPStan/Analyser/nsrt/bug-13061.php @@ -1,4 +1,6 @@ -= 8.1 + +declare(strict_types = 1); namespace Bug13061; diff --git a/tests/PHPStan/Analyser/nsrt/bug-13736.php b/tests/PHPStan/Analyser/nsrt/bug-13736.php index fe237d8df9a..c76d09577ce 100644 --- a/tests/PHPStan/Analyser/nsrt/bug-13736.php +++ b/tests/PHPStan/Analyser/nsrt/bug-13736.php @@ -1,4 +1,6 @@ -= 8.0 + +declare(strict_types = 1); namespace Bug13736; diff --git a/tests/PHPStan/Analyser/nsrt/bug-13828.php b/tests/PHPStan/Analyser/nsrt/bug-13828.php index 551b694536b..ea7a429f5f3 100644 --- a/tests/PHPStan/Analyser/nsrt/bug-13828.php +++ b/tests/PHPStan/Analyser/nsrt/bug-13828.php @@ -1,5 +1,4 @@ -= 8.3 namespace Bug13828; use function PHPStan\Testing\assertType; diff --git a/tests/PHPStan/Analyser/nsrt/bug-13872.php b/tests/PHPStan/Analyser/nsrt/bug-13872.php index 57bf2dadede..9ad8aeb3e53 100644 --- a/tests/PHPStan/Analyser/nsrt/bug-13872.php +++ b/tests/PHPStan/Analyser/nsrt/bug-13872.php @@ -1,5 +1,4 @@ -= 8.1 namespace Bug13872; use function is_array; diff --git a/tests/PHPStan/Analyser/nsrt/bug-13985.php b/tests/PHPStan/Analyser/nsrt/bug-13985.php index 0224007d366..caba1f734ca 100644 --- a/tests/PHPStan/Analyser/nsrt/bug-13985.php +++ b/tests/PHPStan/Analyser/nsrt/bug-13985.php @@ -1,4 +1,4 @@ -= 8.0 namespace Bug13985; diff --git a/tests/PHPStan/Analyser/nsrt/bug-14081.php b/tests/PHPStan/Analyser/nsrt/bug-14081.php index 5e1f3b98071..ea7acd51cfc 100644 --- a/tests/PHPStan/Analyser/nsrt/bug-14081.php +++ b/tests/PHPStan/Analyser/nsrt/bug-14081.php @@ -1,4 +1,4 @@ -= 8.0 declare(strict_types = 1); diff --git a/tests/PHPStan/Analyser/nsrt/bug-14558.php b/tests/PHPStan/Analyser/nsrt/bug-14558.php index 6f6259d4116..e784e8a6f1a 100644 --- a/tests/PHPStan/Analyser/nsrt/bug-14558.php +++ b/tests/PHPStan/Analyser/nsrt/bug-14558.php @@ -1,4 +1,4 @@ -= 8.0 declare(strict_types = 1); diff --git a/tests/PHPStan/Analyser/nsrt/bug-14772.php b/tests/PHPStan/Analyser/nsrt/bug-14772.php index d7f9a7117ad..a74937f9cd4 100644 --- a/tests/PHPStan/Analyser/nsrt/bug-14772.php +++ b/tests/PHPStan/Analyser/nsrt/bug-14772.php @@ -1,4 +1,4 @@ -= 8.0 += 8.1 declare(strict_types = 1); diff --git a/tests/PHPStan/Analyser/nsrt/bug-14774.php b/tests/PHPStan/Analyser/nsrt/bug-14774.php index f63dce4fe68..1f491fc538d 100644 --- a/tests/PHPStan/Analyser/nsrt/bug-14774.php +++ b/tests/PHPStan/Analyser/nsrt/bug-14774.php @@ -1,4 +1,6 @@ -= 8.1 + +declare(strict_types = 1); namespace Bug14774; diff --git a/tests/PHPStan/Analyser/nsrt/bug-4890-php8.php b/tests/PHPStan/Analyser/nsrt/bug-4890-php8.php index 609fb2661c7..0f35350cb0e 100644 --- a/tests/PHPStan/Analyser/nsrt/bug-4890-php8.php +++ b/tests/PHPStan/Analyser/nsrt/bug-4890-php8.php @@ -1,4 +1,4 @@ -= 8.0 += 8.1 namespace Bug4890Php8; diff --git a/tests/PHPStan/Analyser/nsrt/bug-6904.php b/tests/PHPStan/Analyser/nsrt/bug-6904.php index 748e4954c37..8d421c176f4 100644 --- a/tests/PHPStan/Analyser/nsrt/bug-6904.php +++ b/tests/PHPStan/Analyser/nsrt/bug-6904.php @@ -1,4 +1,6 @@ -= 8.1 + +declare(strict_types = 1); namespace Bug6904; diff --git a/tests/PHPStan/Analyser/nsrt/bug-7698.php b/tests/PHPStan/Analyser/nsrt/bug-7698.php index b88ad686173..82af59a358d 100644 --- a/tests/PHPStan/Analyser/nsrt/bug-7698.php +++ b/tests/PHPStan/Analyser/nsrt/bug-7698.php @@ -1,4 +1,4 @@ -= 8.1 namespace Bug7698; diff --git a/tests/PHPStan/Analyser/nsrt/bug-7944.php b/tests/PHPStan/Analyser/nsrt/bug-7944.php index 0d219b40b34..245f4ea91e7 100644 --- a/tests/PHPStan/Analyser/nsrt/bug-7944.php +++ b/tests/PHPStan/Analyser/nsrt/bug-7944.php @@ -1,4 +1,4 @@ -= 8.0 += 8.1 namespace Bug7944; diff --git a/tests/PHPStan/Analyser/nsrt/bug-8421.php b/tests/PHPStan/Analyser/nsrt/bug-8421.php index 00df0caba98..286676aca6d 100644 --- a/tests/PHPStan/Analyser/nsrt/bug-8421.php +++ b/tests/PHPStan/Analyser/nsrt/bug-8421.php @@ -1,4 +1,6 @@ -= 8.0 + +declare(strict_types = 1); namespace Bug8421; diff --git a/tests/PHPStan/Analyser/nsrt/bug-9204.php b/tests/PHPStan/Analyser/nsrt/bug-9204.php index 165a274bf3e..147bfdf7166 100644 --- a/tests/PHPStan/Analyser/nsrt/bug-9204.php +++ b/tests/PHPStan/Analyser/nsrt/bug-9204.php @@ -1,4 +1,6 @@ -= 8.0 + +declare(strict_types = 1); namespace Bug9204; diff --git a/tests/PHPStan/Analyser/nsrt/bug-9634.php b/tests/PHPStan/Analyser/nsrt/bug-9634.php index ad7710b4206..468a9de2b2a 100644 --- a/tests/PHPStan/Analyser/nsrt/bug-9634.php +++ b/tests/PHPStan/Analyser/nsrt/bug-9634.php @@ -1,4 +1,6 @@ -= 8.0 + +declare(strict_types = 1); namespace Bug9634; diff --git a/tests/PHPStan/Analyser/nsrt/bug-9961.php b/tests/PHPStan/Analyser/nsrt/bug-9961.php index 0e3535ee27c..cd410c83e0d 100644 --- a/tests/PHPStan/Analyser/nsrt/bug-9961.php +++ b/tests/PHPStan/Analyser/nsrt/bug-9961.php @@ -1,4 +1,6 @@ -= 8.0 + +declare(strict_types = 1); namespace Bug9961; diff --git a/tests/PHPStan/Analyser/nsrt/bug-nullsafe-prop-static-access.php b/tests/PHPStan/Analyser/nsrt/bug-nullsafe-prop-static-access.php index 82639be3e98..ffcddbf5248 100644 --- a/tests/PHPStan/Analyser/nsrt/bug-nullsafe-prop-static-access.php +++ b/tests/PHPStan/Analyser/nsrt/bug-nullsafe-prop-static-access.php @@ -1,4 +1,4 @@ -= 8.0 += 8.1 declare(strict_types=1); diff --git a/tests/PHPStan/Analyser/nsrt/bug-optionalArrayKeyInMultiDimArrayLoop.php b/tests/PHPStan/Analyser/nsrt/bug-optionalArrayKeyInMultiDimArrayLoop.php index ba4858db63a..8377e8dc9c1 100644 --- a/tests/PHPStan/Analyser/nsrt/bug-optionalArrayKeyInMultiDimArrayLoop.php +++ b/tests/PHPStan/Analyser/nsrt/bug-optionalArrayKeyInMultiDimArrayLoop.php @@ -1,4 +1,6 @@ -= 8.0 + +declare(strict_types = 1); namespace OptionalArrayKeyInMultiDimArrayLoop; diff --git a/tests/PHPStan/Analyser/nsrt/class-constant-narrowing.php b/tests/PHPStan/Analyser/nsrt/class-constant-narrowing.php index 69ae05995d3..27315cc4a4a 100644 --- a/tests/PHPStan/Analyser/nsrt/class-constant-narrowing.php +++ b/tests/PHPStan/Analyser/nsrt/class-constant-narrowing.php @@ -1,4 +1,6 @@ -= 8.1 + +declare(strict_types = 1); namespace ClassConstantNarrowing; diff --git a/tests/PHPStan/Analyser/nsrt/discussion-13395.php b/tests/PHPStan/Analyser/nsrt/discussion-13395.php index 0a48988dde9..3597fb5ce64 100644 --- a/tests/PHPStan/Analyser/nsrt/discussion-13395.php +++ b/tests/PHPStan/Analyser/nsrt/discussion-13395.php @@ -1,4 +1,6 @@ -= 8.2 + +declare(strict_types = 1); namespace Discussion13395; diff --git a/tests/PHPStan/Analyser/nsrt/ds-copy.php b/tests/PHPStan/Analyser/nsrt/ds-copy.php index 8bf29a71ba9..ceedbaf1edd 100644 --- a/tests/PHPStan/Analyser/nsrt/ds-copy.php +++ b/tests/PHPStan/Analyser/nsrt/ds-copy.php @@ -1,5 +1,4 @@ -= 8.1 namespace DsCopy; use Ds\Collection; diff --git a/tests/PHPStan/Analyser/nsrt/override-property-union-type-with-tag-subtype.php b/tests/PHPStan/Analyser/nsrt/override-property-union-type-with-tag-subtype.php index 0312fa7229f..5e9908931c1 100644 --- a/tests/PHPStan/Analyser/nsrt/override-property-union-type-with-tag-subtype.php +++ b/tests/PHPStan/Analyser/nsrt/override-property-union-type-with-tag-subtype.php @@ -1,5 +1,4 @@ -= 8.1 namespace OverridePropertyUnionTypeWithTagSubtype; use function PHPStan\Testing\assertType; diff --git a/tests/PHPStan/Analyser/nsrt/static-late-binding.php b/tests/PHPStan/Analyser/nsrt/static-late-binding.php index 95bbc31067d..ea3c3a44bdc 100644 --- a/tests/PHPStan/Analyser/nsrt/static-late-binding.php +++ b/tests/PHPStan/Analyser/nsrt/static-late-binding.php @@ -1,5 +1,4 @@ -= 8.1 namespace StaticLateBinding; use function PHPStan\Testing\assertType; diff --git a/tests/PHPStan/Build/RequiredPhpVersionCommentTest.php b/tests/PHPStan/Build/RequiredPhpVersionCommentTest.php new file mode 100644 index 00000000000..5af1af0dc0b --- /dev/null +++ b/tests/PHPStan/Build/RequiredPhpVersionCommentTest.php @@ -0,0 +1,220 @@ += X.Y` comment to advertise the PHP version their syntax requires: + * the `nsrt` directory plus every `data` directory below tests/PHPStan/Rules. + * + * @return iterable + */ + public static function dataFixtures(): iterable + { + $directories = [ + __DIR__ . '/../Analyser/data', + __DIR__ . '/../Analyser/nsrt', + __DIR__ . '/../Analyser/Fiber/data', + ]; + + $dataFinder = new Finder(); + $dataFinder->followLinks(); + foreach ($dataFinder->directories()->name('data')->in(__DIR__ . '/../Rules') as $dirInfo) { + $directories[] = $dirInfo->getPathname(); + } + + $finder = new Finder(); + $finder->followLinks(); + foreach ($finder->files()->name('*.php')->in($directories) as $fileInfo) { + $path = $fileInfo->getPathname(); + yield $path => [$path]; + } + } + + #[DataProvider('dataFixtures')] + public function testFixtureHasRequiredLintComment(string $file): void + { + $code = file_get_contents($file); + if ($code === false) { + self::fail(sprintf('Could not read %s', $file)); + } + + $parser = (new ParserFactory())->createForNewestSupportedVersion(); + try { + $ast = $parser->parse($code); + } catch (ParserError) { + // Some fixtures intentionally contain syntax errors; the required PHP + // version cannot be (and need not be) determined for those. + $this->expectNotToPerformAssertions(); + return; + } + if ($ast === null) { + $this->expectNotToPerformAssertions(); + return; + } + + $visitor = new RequiredPhpVersionVisitor(); + $traverser = new NodeTraverser($visitor); + $traverser->traverse($ast); + + $requiredVersionId = $visitor->getRequiredVersionId(); + if ($requiredVersionId === null) { + $this->expectNotToPerformAssertions(); + return; + } + + $requiredVersion = new PhpVersion($requiredVersionId); + $guaranteedMinVersionId = self::guaranteedMinVersionId($code); + + // The `mixed` type is not a parse error on PHP < 8.0 - there it parses as a + // class type and is merely analysed differently. Fixtures that deliberately + // target old PHP via an upper-bound `// lint` constraint (e.g. to assert a + // version-specific function signature) may therefore use it; the author owns + // that choice. Parse-breaking features (enums, hooks, ...) are still rejected. + if ( + $requiredVersionId === RequiredPhpVersionVisitor::PHP_8_0 + && self::hasUpperBoundLintConstraint($code) + ) { + $this->expectNotToPerformAssertions(); + return; + } + + $reasonLine = $visitor->getReasonLine(); + self::assertNotNull($reasonLine); + self::assertGreaterThanOrEqual( + $requiredVersionId, + $guaranteedMinVersionId, + sprintf( + 'Fixture uses %s on line %d which requires PHP %s. Add a `= %s` comment on the first line so the fixture is skipped on older PHP versions in CI.', + $visitor->getReason(), + $reasonLine, + $requiredVersion->getVersionString(), + $requiredVersion->getVersionString(), + ), + ); + } + + /** + * @return iterable + */ + public static function dataDetectedVersion(): iterable + { + yield 'plain code' => [' [' [' [' [' [' [' [' [' [' [' [' [' [' [' [' [' [' 1; } }', 80400]; + yield 'asymmetric visibility' => [' [' strlen(...);', 80500]; + } + + #[DataProvider('dataDetectedVersion')] + public function testDetectedVersion(string $code, ?int $expectedVersionId): void + { + $parser = (new ParserFactory())->createForNewestSupportedVersion(); + $ast = $parser->parse($code); + self::assertNotNull($ast); + + $visitor = new RequiredPhpVersionVisitor(); + $traverser = new NodeTraverser($visitor); + $traverser->traverse($ast); + + self::assertSame($expectedVersionId, $visitor->getRequiredVersionId()); + } + + public function testReasonLine(): void + { + $code = "createForNewestSupportedVersion(); + $ast = $parser->parse($code); + self::assertNotNull($ast); + + $visitor = new RequiredPhpVersionVisitor(); + $traverser = new NodeTraverser($visitor); + $traverser->traverse($ast); + + self::assertSame(80100, $visitor->getRequiredVersionId()); + self::assertSame('enums', $visitor->getReason()); + self::assertSame(4, $visitor->getReasonLine()); + } + + private static function guaranteedMinVersionId(string $code): int + { + $firstLine = strtok($code, "\n"); + if ($firstLine === false) { + return 0; + } + + // Match the `// lint` comment anywhere on the first line. parallel-lint and + // TypeInferenceTestCase require it to immediately follow `=|==|=|<|>)\s*([\d.]+)~i', $firstLine, $matches) !== 1) { + return 0; + } + + $operator = $matches[1]; + $versionId = self::versionStringToId($matches[2]); + + // Only lower-bound constraints guarantee that newer syntax is available. + // "< X" / "<= X" mean the file also runs on older PHP, so it must not use + // any version-gated feature. + if ($operator === '>=' || $operator === '>' || $operator === '==' || $operator === '=') { + return $versionId; + } + + return 0; + } + + private static function hasUpperBoundLintConstraint(string $code): bool + { + $firstLine = strtok($code, "\n"); + if ($firstLine === false) { + return false; + } + + return preg_match('~//\s*lint\s*(<=|<)\s*[\d.]+~i', $firstLine) === 1; + } + + private static function versionStringToId(string $version): int + { + $parts = explode('.', $version); + $major = (int) $parts[0]; + $minor = (int) ($parts[1] ?? 0); + $patch = (int) ($parts[2] ?? 0); + + return $major * 10000 + $minor * 100 + $patch; + } + +} diff --git a/tests/PHPStan/Rules/Arrays/data/bug-6564.php b/tests/PHPStan/Rules/Arrays/data/bug-6564.php index 565310c9dfc..d3cd2eaecf2 100644 --- a/tests/PHPStan/Rules/Arrays/data/bug-6564.php +++ b/tests/PHPStan/Rules/Arrays/data/bug-6564.php @@ -1,4 +1,4 @@ -= 8.0 namespace Bug6564; diff --git a/tests/PHPStan/Rules/Arrays/data/pr-4385-bis.php b/tests/PHPStan/Rules/Arrays/data/pr-4385-bis.php index b6351230c91..97d0d9748c1 100644 --- a/tests/PHPStan/Rules/Arrays/data/pr-4385-bis.php +++ b/tests/PHPStan/Rules/Arrays/data/pr-4385-bis.php @@ -1,4 +1,4 @@ -= 8.0 namespace Pr4385Bis; diff --git a/tests/PHPStan/Rules/Classes/data/bug-10036.php b/tests/PHPStan/Rules/Classes/data/bug-10036.php index e2894e9a1d3..80b8a1f05d0 100644 --- a/tests/PHPStan/Rules/Classes/data/bug-10036.php +++ b/tests/PHPStan/Rules/Classes/data/bug-10036.php @@ -1,4 +1,4 @@ -= 8.0 namespace Bug10036; diff --git a/tests/PHPStan/Rules/Classes/data/bug-14617.php b/tests/PHPStan/Rules/Classes/data/bug-14617.php index 2398a9a70fc..c8ef8ec7d64 100644 --- a/tests/PHPStan/Rules/Classes/data/bug-14617.php +++ b/tests/PHPStan/Rules/Classes/data/bug-14617.php @@ -1,4 +1,4 @@ -= 8.0 namespace Bug14617Classes; diff --git a/tests/PHPStan/Rules/Classes/data/bug-7720.php b/tests/PHPStan/Rules/Classes/data/bug-7720.php index ff20bd0e610..77c4b0e7efa 100644 --- a/tests/PHPStan/Rules/Classes/data/bug-7720.php +++ b/tests/PHPStan/Rules/Classes/data/bug-7720.php @@ -1,4 +1,4 @@ -= 8.0 namespace Bug7720; diff --git a/tests/PHPStan/Rules/Classes/data/extends-readonly-class.php b/tests/PHPStan/Rules/Classes/data/extends-readonly-class.php index cf134c3a2b6..56e9901dc37 100644 --- a/tests/PHPStan/Rules/Classes/data/extends-readonly-class.php +++ b/tests/PHPStan/Rules/Classes/data/extends-readonly-class.php @@ -1,4 +1,4 @@ -= 8.2 namespace ExtendsReadOnlyClass; diff --git a/tests/PHPStan/Rules/Classes/data/invalid-hooked-properties.php b/tests/PHPStan/Rules/Classes/data/invalid-hooked-properties.php index e0933face14..dfc09bafade 100644 --- a/tests/PHPStan/Rules/Classes/data/invalid-hooked-properties.php +++ b/tests/PHPStan/Rules/Classes/data/invalid-hooked-properties.php @@ -1,4 +1,4 @@ -= 8.4 namespace InvalidHookedProperties; diff --git a/tests/PHPStan/Rules/Comparison/data/bug-11161.php b/tests/PHPStan/Rules/Comparison/data/bug-11161.php index e6d7a18bedd..0635df57357 100644 --- a/tests/PHPStan/Rules/Comparison/data/bug-11161.php +++ b/tests/PHPStan/Rules/Comparison/data/bug-11161.php @@ -1,4 +1,4 @@ -= 8.0 namespace Bug11161; diff --git a/tests/PHPStan/Rules/Comparison/data/bug-13268.php b/tests/PHPStan/Rules/Comparison/data/bug-13268.php index 0bdbd130eb4..d98e5a79603 100644 --- a/tests/PHPStan/Rules/Comparison/data/bug-13268.php +++ b/tests/PHPStan/Rules/Comparison/data/bug-13268.php @@ -1,4 +1,4 @@ -= 8.0 namespace Bug13268; diff --git a/tests/PHPStan/Rules/Comparison/data/bug-6211.php b/tests/PHPStan/Rules/Comparison/data/bug-6211.php index 9d5b806db5b..bdc74fc87a5 100644 --- a/tests/PHPStan/Rules/Comparison/data/bug-6211.php +++ b/tests/PHPStan/Rules/Comparison/data/bug-6211.php @@ -1,4 +1,4 @@ -= 8.0 namespace Bug6211; diff --git a/tests/PHPStan/Rules/Comparison/data/bug-6443.php b/tests/PHPStan/Rules/Comparison/data/bug-6443.php index e9e4383463f..8c53a56ab71 100644 --- a/tests/PHPStan/Rules/Comparison/data/bug-6443.php +++ b/tests/PHPStan/Rules/Comparison/data/bug-6443.php @@ -1,4 +1,4 @@ -= 8.0 namespace Bug6443; diff --git a/tests/PHPStan/Rules/Comparison/data/bug-8217.php b/tests/PHPStan/Rules/Comparison/data/bug-8217.php index 7da3fe99468..6c570d89641 100644 --- a/tests/PHPStan/Rules/Comparison/data/bug-8217.php +++ b/tests/PHPStan/Rules/Comparison/data/bug-8217.php @@ -1,4 +1,4 @@ -= 8.0 namespace Bug8217; diff --git a/tests/PHPStan/Rules/Comparison/data/check-type-function-call.php b/tests/PHPStan/Rules/Comparison/data/check-type-function-call.php index e84f4f09014..e9d5da7774a 100644 --- a/tests/PHPStan/Rules/Comparison/data/check-type-function-call.php +++ b/tests/PHPStan/Rules/Comparison/data/check-type-function-call.php @@ -1,4 +1,4 @@ -= 8.0 namespace CheckTypeFunctionCall; diff --git a/tests/PHPStan/Rules/Comparison/data/impossible-method-call-in-trait.php b/tests/PHPStan/Rules/Comparison/data/impossible-method-call-in-trait.php index 86c0de8769a..2ba0678430a 100644 --- a/tests/PHPStan/Rules/Comparison/data/impossible-method-call-in-trait.php +++ b/tests/PHPStan/Rules/Comparison/data/impossible-method-call-in-trait.php @@ -1,4 +1,4 @@ -= 8.0 namespace ImpossibleMethodCallInTrait; diff --git a/tests/PHPStan/Rules/Comparison/data/impossible-static-method-call-in-trait.php b/tests/PHPStan/Rules/Comparison/data/impossible-static-method-call-in-trait.php index b11bf5ba709..176c81da2d3 100644 --- a/tests/PHPStan/Rules/Comparison/data/impossible-static-method-call-in-trait.php +++ b/tests/PHPStan/Rules/Comparison/data/impossible-static-method-call-in-trait.php @@ -1,4 +1,4 @@ -= 8.0 namespace ImpossibleStaticMethodCallInTrait; diff --git a/tests/PHPStan/Rules/Constants/data/bug-7273.php b/tests/PHPStan/Rules/Constants/data/bug-7273.php index b21ffc9d58e..e40e4f1ef26 100644 --- a/tests/PHPStan/Rules/Constants/data/bug-7273.php +++ b/tests/PHPStan/Rules/Constants/data/bug-7273.php @@ -1,4 +1,4 @@ -= 8.0 namespace Bug7273; diff --git a/tests/PHPStan/Rules/Constants/data/dynamic-class-constant-fetch.php b/tests/PHPStan/Rules/Constants/data/dynamic-class-constant-fetch.php index 66ea350f8d8..a7e8b106b13 100644 --- a/tests/PHPStan/Rules/Constants/data/dynamic-class-constant-fetch.php +++ b/tests/PHPStan/Rules/Constants/data/dynamic-class-constant-fetch.php @@ -1,4 +1,4 @@ -= 8.3 namespace DynamicClassConstantFetch; diff --git a/tests/PHPStan/Rules/DeadCode/data/bug-13232b.php b/tests/PHPStan/Rules/DeadCode/data/bug-13232b.php index 9818fb7849c..be1123f32df 100644 --- a/tests/PHPStan/Rules/DeadCode/data/bug-13232b.php +++ b/tests/PHPStan/Rules/DeadCode/data/bug-13232b.php @@ -1,4 +1,4 @@ -= 8.0 namespace Bug13232b; diff --git a/tests/PHPStan/Rules/Exceptions/data/bug-9146-non-strict.php b/tests/PHPStan/Rules/Exceptions/data/bug-9146-non-strict.php index fd9c9a85ab8..b20e461395b 100644 --- a/tests/PHPStan/Rules/Exceptions/data/bug-9146-non-strict.php +++ b/tests/PHPStan/Rules/Exceptions/data/bug-9146-non-strict.php @@ -1,4 +1,4 @@ -= 8.0 namespace Bug9146NonStrict; diff --git a/tests/PHPStan/Rules/Exceptions/data/bug-9146.php b/tests/PHPStan/Rules/Exceptions/data/bug-9146.php index 2572869e087..b075b11d09f 100644 --- a/tests/PHPStan/Rules/Exceptions/data/bug-9146.php +++ b/tests/PHPStan/Rules/Exceptions/data/bug-9146.php @@ -1,4 +1,4 @@ -= 8.0 namespace Bug9146; diff --git a/tests/PHPStan/Rules/Exceptions/data/bug-array-offset.php b/tests/PHPStan/Rules/Exceptions/data/bug-array-offset.php index 35bf9543e8a..7785a251b76 100644 --- a/tests/PHPStan/Rules/Exceptions/data/bug-array-offset.php +++ b/tests/PHPStan/Rules/Exceptions/data/bug-array-offset.php @@ -1,4 +1,4 @@ -= 8.0 namespace BugArrayOffset; diff --git a/tests/PHPStan/Rules/Functions/data/bug-10297.php b/tests/PHPStan/Rules/Functions/data/bug-10297.php index ed3a8cf3dd6..ff3f74e1423 100644 --- a/tests/PHPStan/Rules/Functions/data/bug-10297.php +++ b/tests/PHPStan/Rules/Functions/data/bug-10297.php @@ -1,4 +1,4 @@ -= 8.0 namespace Bug10297; diff --git a/tests/PHPStan/Rules/Functions/data/bug-11056.php b/tests/PHPStan/Rules/Functions/data/bug-11056.php index 6c4b8abea1e..47713b20450 100644 --- a/tests/PHPStan/Rules/Functions/data/bug-11056.php +++ b/tests/PHPStan/Rules/Functions/data/bug-11056.php @@ -1,4 +1,4 @@ -= 8.1 namespace Bug11056; diff --git a/tests/PHPStan/Rules/Functions/data/bug-11079.php b/tests/PHPStan/Rules/Functions/data/bug-11079.php index 6c0bc8de723..ba9853d73a4 100644 --- a/tests/PHPStan/Rules/Functions/data/bug-11079.php +++ b/tests/PHPStan/Rules/Functions/data/bug-11079.php @@ -1,4 +1,4 @@ -= 8.0 namespace Bug11079; diff --git a/tests/PHPStan/Rules/Functions/data/bug-11126.php b/tests/PHPStan/Rules/Functions/data/bug-11126.php index 8569f55ac05..77a5e4c8bdf 100644 --- a/tests/PHPStan/Rules/Functions/data/bug-11126.php +++ b/tests/PHPStan/Rules/Functions/data/bug-11126.php @@ -1,4 +1,4 @@ -= 8.1 namespace Bug11126; diff --git a/tests/PHPStan/Rules/Functions/data/bug-11386.php b/tests/PHPStan/Rules/Functions/data/bug-11386.php index c9fd4cd24f2..eab0044f8a4 100644 --- a/tests/PHPStan/Rules/Functions/data/bug-11386.php +++ b/tests/PHPStan/Rules/Functions/data/bug-11386.php @@ -1,4 +1,4 @@ -= 8.0 namespace Bug11386; diff --git a/tests/PHPStan/Rules/Functions/data/bug-11894.php b/tests/PHPStan/Rules/Functions/data/bug-11894.php index 798919a5d6e..24c88017018 100644 --- a/tests/PHPStan/Rules/Functions/data/bug-11894.php +++ b/tests/PHPStan/Rules/Functions/data/bug-11894.php @@ -1,4 +1,4 @@ -= 8.0 namespace Bug11894; diff --git a/tests/PHPStan/Rules/Functions/data/bug-11942.php b/tests/PHPStan/Rules/Functions/data/bug-11942.php index 33bd0ff1abf..91e7788b25f 100644 --- a/tests/PHPStan/Rules/Functions/data/bug-11942.php +++ b/tests/PHPStan/Rules/Functions/data/bug-11942.php @@ -1,4 +1,4 @@ -= 8.1 namespace Bug11942; diff --git a/tests/PHPStan/Rules/Functions/data/bug-11982.php b/tests/PHPStan/Rules/Functions/data/bug-11982.php index 4b9a78e4cab..377080a8e72 100644 --- a/tests/PHPStan/Rules/Functions/data/bug-11982.php +++ b/tests/PHPStan/Rules/Functions/data/bug-11982.php @@ -1,4 +1,4 @@ -= 8.1 namespace Bug11982; diff --git a/tests/PHPStan/Rules/Functions/data/bug-12224.php b/tests/PHPStan/Rules/Functions/data/bug-12224.php index 9970576bcac..236bf00dfba 100644 --- a/tests/PHPStan/Rules/Functions/data/bug-12224.php +++ b/tests/PHPStan/Rules/Functions/data/bug-12224.php @@ -1,4 +1,4 @@ -= 8.0 namespace Bug12224Function; diff --git a/tests/PHPStan/Rules/Functions/data/bug-12847.php b/tests/PHPStan/Rules/Functions/data/bug-12847.php index c4880d83f6a..385307a4e74 100644 --- a/tests/PHPStan/Rules/Functions/data/bug-12847.php +++ b/tests/PHPStan/Rules/Functions/data/bug-12847.php @@ -1,4 +1,4 @@ -= 8.0 namespace Bug12847; diff --git a/tests/PHPStan/Rules/Functions/data/bug-14312.php b/tests/PHPStan/Rules/Functions/data/bug-14312.php index c07ceac0bbf..e494b409cd8 100644 --- a/tests/PHPStan/Rules/Functions/data/bug-14312.php +++ b/tests/PHPStan/Rules/Functions/data/bug-14312.php @@ -1,4 +1,4 @@ -= 8.0 namespace Bug14312; diff --git a/tests/PHPStan/Rules/Functions/data/bug-14312b.php b/tests/PHPStan/Rules/Functions/data/bug-14312b.php index 7909f6a4b61..7eddb8b4917 100644 --- a/tests/PHPStan/Rules/Functions/data/bug-14312b.php +++ b/tests/PHPStan/Rules/Functions/data/bug-14312b.php @@ -1,4 +1,4 @@ -= 8.0 namespace Bug14312b; diff --git a/tests/PHPStan/Rules/Functions/data/bug-3818b.php b/tests/PHPStan/Rules/Functions/data/bug-3818b.php index 0a9a3d6c831..3e3fe0cfc08 100644 --- a/tests/PHPStan/Rules/Functions/data/bug-3818b.php +++ b/tests/PHPStan/Rules/Functions/data/bug-3818b.php @@ -1,4 +1,4 @@ -= 8.1 namespace Bug3818b; diff --git a/tests/PHPStan/Rules/Functions/data/bug-5206.php b/tests/PHPStan/Rules/Functions/data/bug-5206.php index 58738ac19a8..0d1b0e35c07 100644 --- a/tests/PHPStan/Rules/Functions/data/bug-5206.php +++ b/tests/PHPStan/Rules/Functions/data/bug-5206.php @@ -1,4 +1,4 @@ -= 8.0 namespace Bug5206; diff --git a/tests/PHPStan/Rules/Functions/data/bug-5881.php b/tests/PHPStan/Rules/Functions/data/bug-5881.php index d586c9e246b..5d7cb663b68 100644 --- a/tests/PHPStan/Rules/Functions/data/bug-5881.php +++ b/tests/PHPStan/Rules/Functions/data/bug-5881.php @@ -1,4 +1,4 @@ -= 8.0 namespace Bug5881; diff --git a/tests/PHPStan/Rules/Functions/data/bug-6175.php b/tests/PHPStan/Rules/Functions/data/bug-6175.php index 48ba0f2d0d1..5eec18ba0c7 100644 --- a/tests/PHPStan/Rules/Functions/data/bug-6175.php +++ b/tests/PHPStan/Rules/Functions/data/bug-6175.php @@ -1,4 +1,4 @@ -= 8.0 namespace Bug6715Functions; diff --git a/tests/PHPStan/Rules/Functions/data/bug-7156.php b/tests/PHPStan/Rules/Functions/data/bug-7156.php index 3757e952dc1..861656f497d 100644 --- a/tests/PHPStan/Rules/Functions/data/bug-7156.php +++ b/tests/PHPStan/Rules/Functions/data/bug-7156.php @@ -1,4 +1,4 @@ -= 8.0 namespace Bug7156; diff --git a/tests/PHPStan/Rules/Functions/data/bug-7283.php b/tests/PHPStan/Rules/Functions/data/bug-7283.php index ecf155d62a2..fb902225d21 100644 --- a/tests/PHPStan/Rules/Functions/data/bug-7283.php +++ b/tests/PHPStan/Rules/Functions/data/bug-7283.php @@ -1,4 +1,4 @@ -= 8.0 namespace Bug7283; diff --git a/tests/PHPStan/Rules/Functions/data/bug-7984.php b/tests/PHPStan/Rules/Functions/data/bug-7984.php index 2ba1d267c70..4f413228188 100644 --- a/tests/PHPStan/Rules/Functions/data/bug-7984.php +++ b/tests/PHPStan/Rules/Functions/data/bug-7984.php @@ -1,4 +1,4 @@ -= 8.0 namespace Bug7984; diff --git a/tests/PHPStan/Rules/Functions/data/bug-8846.php b/tests/PHPStan/Rules/Functions/data/bug-8846.php index a4fc961d4c6..1488179dc7e 100644 --- a/tests/PHPStan/Rules/Functions/data/bug-8846.php +++ b/tests/PHPStan/Rules/Functions/data/bug-8846.php @@ -1,4 +1,4 @@ -= 8.1 namespace Bug8846; diff --git a/tests/PHPStan/Rules/Functions/data/bug-9133.php b/tests/PHPStan/Rules/Functions/data/bug-9133.php index a17b650920d..efcccecc10a 100644 --- a/tests/PHPStan/Rules/Functions/data/bug-9133.php +++ b/tests/PHPStan/Rules/Functions/data/bug-9133.php @@ -1,4 +1,4 @@ -= 8.0 namespace Bug9133; diff --git a/tests/PHPStan/Rules/Functions/data/bug-9167.php b/tests/PHPStan/Rules/Functions/data/bug-9167.php index 63d623bb4c5..f7f3a3d4a4a 100644 --- a/tests/PHPStan/Rules/Functions/data/bug-9167.php +++ b/tests/PHPStan/Rules/Functions/data/bug-9167.php @@ -1,4 +1,4 @@ -= 8.1 namespace Bug9167; diff --git a/tests/PHPStan/Rules/Functions/data/bug-9580.php b/tests/PHPStan/Rules/Functions/data/bug-9580.php index 1b6feb16fc4..7bcf8492dbc 100644 --- a/tests/PHPStan/Rules/Functions/data/bug-9580.php +++ b/tests/PHPStan/Rules/Functions/data/bug-9580.php @@ -1,4 +1,4 @@ -= 8.2 namespace Bug9580; diff --git a/tests/PHPStan/Rules/Functions/data/call-first-class-callables.php b/tests/PHPStan/Rules/Functions/data/call-first-class-callables.php index 4e78b9bb770..72c936878e5 100644 --- a/tests/PHPStan/Rules/Functions/data/call-first-class-callables.php +++ b/tests/PHPStan/Rules/Functions/data/call-first-class-callables.php @@ -1,4 +1,4 @@ -= 8.1 namespace CallFirstClassCallables; diff --git a/tests/PHPStan/Rules/Functions/data/conditional-return-type.php b/tests/PHPStan/Rules/Functions/data/conditional-return-type.php index d33c6eb1282..027e0b2ee82 100644 --- a/tests/PHPStan/Rules/Functions/data/conditional-return-type.php +++ b/tests/PHPStan/Rules/Functions/data/conditional-return-type.php @@ -1,4 +1,4 @@ -= 8.0 namespace FunctionConditionalReturnType; diff --git a/tests/PHPStan/Rules/Functions/data/constant-parameter-check-callables.php b/tests/PHPStan/Rules/Functions/data/constant-parameter-check-callables.php index 6acb0ba1876..9fa10a94055 100644 --- a/tests/PHPStan/Rules/Functions/data/constant-parameter-check-callables.php +++ b/tests/PHPStan/Rules/Functions/data/constant-parameter-check-callables.php @@ -1,4 +1,4 @@ -= 8.1 namespace ConstantParameterCheckCallables; diff --git a/tests/PHPStan/Rules/Functions/data/function-call-statement-result-discarded.php b/tests/PHPStan/Rules/Functions/data/function-call-statement-result-discarded.php index b2445f96ce8..a7fa4c8b1e8 100644 --- a/tests/PHPStan/Rules/Functions/data/function-call-statement-result-discarded.php +++ b/tests/PHPStan/Rules/Functions/data/function-call-statement-result-discarded.php @@ -1,4 +1,4 @@ -= 8.1 += 8.5 namespace FunctionCallStatementResultDiscarded; diff --git a/tests/PHPStan/Rules/Functions/data/param-out.php b/tests/PHPStan/Rules/Functions/data/param-out.php index 637750be986..6881f8191d4 100644 --- a/tests/PHPStan/Rules/Functions/data/param-out.php +++ b/tests/PHPStan/Rules/Functions/data/param-out.php @@ -1,4 +1,4 @@ -= 8.0 namespace ParamOutTemplate; diff --git a/tests/PHPStan/Rules/Generics/data/bug-10609.php b/tests/PHPStan/Rules/Generics/data/bug-10609.php index c62a9e0a10a..eebfe91d1b2 100644 --- a/tests/PHPStan/Rules/Generics/data/bug-10609.php +++ b/tests/PHPStan/Rules/Generics/data/bug-10609.php @@ -1,4 +1,4 @@ -= 8.0 namespace Bug10609; diff --git a/tests/PHPStan/Rules/Methods/data/bug-10715.php b/tests/PHPStan/Rules/Methods/data/bug-10715.php index 82cd7f66ae2..b74f2cf7c67 100644 --- a/tests/PHPStan/Rules/Methods/data/bug-10715.php +++ b/tests/PHPStan/Rules/Methods/data/bug-10715.php @@ -1,4 +1,4 @@ -= 8.1 namespace Bug10715; diff --git a/tests/PHPStan/Rules/Methods/data/bug-10956.php b/tests/PHPStan/Rules/Methods/data/bug-10956.php index 459d5bd6c29..1381c603b11 100644 --- a/tests/PHPStan/Rules/Methods/data/bug-10956.php +++ b/tests/PHPStan/Rules/Methods/data/bug-10956.php @@ -1,4 +1,4 @@ -= 8.0 namespace Bug10956; diff --git a/tests/PHPStan/Rules/Methods/data/bug-11491.php b/tests/PHPStan/Rules/Methods/data/bug-11491.php index 9369b36610f..a27c4d1da69 100644 --- a/tests/PHPStan/Rules/Methods/data/bug-11491.php +++ b/tests/PHPStan/Rules/Methods/data/bug-11491.php @@ -1,4 +1,4 @@ -= 8.3 namespace PHPStan\Rules\Methods\data; diff --git a/tests/PHPStan/Rules/Methods/data/bug-11894.php b/tests/PHPStan/Rules/Methods/data/bug-11894.php index 7b4daf0ada4..0cfe4bb2ca9 100644 --- a/tests/PHPStan/Rules/Methods/data/bug-11894.php +++ b/tests/PHPStan/Rules/Methods/data/bug-11894.php @@ -1,4 +1,4 @@ -= 8.0 namespace Bug11894Methods; diff --git a/tests/PHPStan/Rules/Methods/data/bug-12224.php b/tests/PHPStan/Rules/Methods/data/bug-12224.php index 42ee7864cc3..910063e0142 100644 --- a/tests/PHPStan/Rules/Methods/data/bug-12224.php +++ b/tests/PHPStan/Rules/Methods/data/bug-12224.php @@ -1,4 +1,4 @@ -= 8.0 namespace Bug12224Method; diff --git a/tests/PHPStan/Rules/Methods/data/bug-12663.php b/tests/PHPStan/Rules/Methods/data/bug-12663.php index c1eaf5e8675..f171cdd0bf6 100644 --- a/tests/PHPStan/Rules/Methods/data/bug-12663.php +++ b/tests/PHPStan/Rules/Methods/data/bug-12663.php @@ -1,4 +1,4 @@ -= 8.0 namespace Bug12663; diff --git a/tests/PHPStan/Rules/Methods/data/bug-12940.php b/tests/PHPStan/Rules/Methods/data/bug-12940.php index ad00e11c1b3..bb42f5b6868 100644 --- a/tests/PHPStan/Rules/Methods/data/bug-12940.php +++ b/tests/PHPStan/Rules/Methods/data/bug-12940.php @@ -1,4 +1,4 @@ -= 8.0 namespace Bug12940; diff --git a/tests/PHPStan/Rules/Methods/data/bug-13043.php b/tests/PHPStan/Rules/Methods/data/bug-13043.php index 405cb753832..dc8e540440b 100644 --- a/tests/PHPStan/Rules/Methods/data/bug-13043.php +++ b/tests/PHPStan/Rules/Methods/data/bug-13043.php @@ -1,4 +1,4 @@ -= 8.1 namespace Bug13043; diff --git a/tests/PHPStan/Rules/Methods/data/bug-13881.php b/tests/PHPStan/Rules/Methods/data/bug-13881.php index a618bd5b704..b768a033a83 100644 --- a/tests/PHPStan/Rules/Methods/data/bug-13881.php +++ b/tests/PHPStan/Rules/Methods/data/bug-13881.php @@ -1,4 +1,4 @@ -= 8.0 namespace Bug13881; diff --git a/tests/PHPStan/Rules/Methods/data/bug-6104.php b/tests/PHPStan/Rules/Methods/data/bug-6104.php index 319a1fdd5fc..205155027df 100644 --- a/tests/PHPStan/Rules/Methods/data/bug-6104.php +++ b/tests/PHPStan/Rules/Methods/data/bug-6104.php @@ -1,4 +1,4 @@ -= 8.0 namespace Bug6104; diff --git a/tests/PHPStan/Rules/Methods/data/bug-6635.php b/tests/PHPStan/Rules/Methods/data/bug-6635.php index 4d981a6a6f0..16b5b7b12fd 100644 --- a/tests/PHPStan/Rules/Methods/data/bug-6635.php +++ b/tests/PHPStan/Rules/Methods/data/bug-6635.php @@ -1,4 +1,4 @@ -= 8.0 namespace Bug6635; diff --git a/tests/PHPStan/Rules/Methods/data/bug-6904.php b/tests/PHPStan/Rules/Methods/data/bug-6904.php index 92b95583ff4..ee800415648 100644 --- a/tests/PHPStan/Rules/Methods/data/bug-6904.php +++ b/tests/PHPStan/Rules/Methods/data/bug-6904.php @@ -1,4 +1,4 @@ -= 8.1 namespace Bug6904Rule; diff --git a/tests/PHPStan/Rules/Methods/data/bug-7600.php b/tests/PHPStan/Rules/Methods/data/bug-7600.php index 5cd0a400e8d..3d60b837046 100644 --- a/tests/PHPStan/Rules/Methods/data/bug-7600.php +++ b/tests/PHPStan/Rules/Methods/data/bug-7600.php @@ -1,4 +1,4 @@ -= 8.0 namespace Bug7600; diff --git a/tests/PHPStan/Rules/Methods/data/bug-7652.php b/tests/PHPStan/Rules/Methods/data/bug-7652.php index de20d716473..45979bccc46 100644 --- a/tests/PHPStan/Rules/Methods/data/bug-7652.php +++ b/tests/PHPStan/Rules/Methods/data/bug-7652.php @@ -1,4 +1,4 @@ -= 8.0 namespace Bug7652; diff --git a/tests/PHPStan/Rules/Methods/data/bug-7859.php b/tests/PHPStan/Rules/Methods/data/bug-7859.php index 0cb1fb7f60b..5220f085cc7 100644 --- a/tests/PHPStan/Rules/Methods/data/bug-7859.php +++ b/tests/PHPStan/Rules/Methods/data/bug-7859.php @@ -1,4 +1,4 @@ -= 8.0 namespace Bug7859; diff --git a/tests/PHPStan/Rules/Methods/data/bug-9951.php b/tests/PHPStan/Rules/Methods/data/bug-9951.php index ab7096f27ed..bc9029e23bb 100644 --- a/tests/PHPStan/Rules/Methods/data/bug-9951.php +++ b/tests/PHPStan/Rules/Methods/data/bug-9951.php @@ -1,4 +1,4 @@ -= 8.0 namespace Bug9951; diff --git a/tests/PHPStan/Rules/Methods/data/conditional-return-type.php b/tests/PHPStan/Rules/Methods/data/conditional-return-type.php index 809cbd07989..183ca76018b 100644 --- a/tests/PHPStan/Rules/Methods/data/conditional-return-type.php +++ b/tests/PHPStan/Rules/Methods/data/conditional-return-type.php @@ -1,4 +1,4 @@ -= 8.0 namespace MethodConditionalReturnType; diff --git a/tests/PHPStan/Rules/Methods/data/enums-typehints.php b/tests/PHPStan/Rules/Methods/data/enums-typehints.php index 0ce822e3f33..d7420127ac3 100644 --- a/tests/PHPStan/Rules/Methods/data/enums-typehints.php +++ b/tests/PHPStan/Rules/Methods/data/enums-typehints.php @@ -1,4 +1,4 @@ -= 8.1 namespace EnumsTypehints; diff --git a/tests/PHPStan/Rules/Methods/data/magic-signatures.php b/tests/PHPStan/Rules/Methods/data/magic-signatures.php index 0d71caa4708..123735c1085 100644 --- a/tests/PHPStan/Rules/Methods/data/magic-signatures.php +++ b/tests/PHPStan/Rules/Methods/data/magic-signatures.php @@ -1,4 +1,4 @@ -= 8.0 namespace MagicSignatures; diff --git a/tests/PHPStan/Rules/Methods/data/method-call-statement-result-discarded.php b/tests/PHPStan/Rules/Methods/data/method-call-statement-result-discarded.php index 378d7afa458..194f9753ff7 100644 --- a/tests/PHPStan/Rules/Methods/data/method-call-statement-result-discarded.php +++ b/tests/PHPStan/Rules/Methods/data/method-call-statement-result-discarded.php @@ -1,4 +1,4 @@ -= 8.5 namespace MethodCallStatementResultDiscarded; diff --git a/tests/PHPStan/Rules/Methods/data/method-implicitly-nullable.php b/tests/PHPStan/Rules/Methods/data/method-implicitly-nullable.php index f5690b2c727..5b45c590442 100644 --- a/tests/PHPStan/Rules/Methods/data/method-implicitly-nullable.php +++ b/tests/PHPStan/Rules/Methods/data/method-implicitly-nullable.php @@ -1,4 +1,4 @@ -= 8.0 namespace MethodImplicitNullable; diff --git a/tests/PHPStan/Rules/Methods/data/method-misleading-mixed-return.php b/tests/PHPStan/Rules/Methods/data/method-misleading-mixed-return.php index e7c1b2141a7..1ec26d137e3 100644 --- a/tests/PHPStan/Rules/Methods/data/method-misleading-mixed-return.php +++ b/tests/PHPStan/Rules/Methods/data/method-misleading-mixed-return.php @@ -1,4 +1,4 @@ -= 8.0 namespace MethodMisleadingMixedReturn; diff --git a/tests/PHPStan/Rules/Methods/data/misleadingTypehints.php b/tests/PHPStan/Rules/Methods/data/misleadingTypehints.php index ef1c3b6c42f..c6e4cc5d75f 100644 --- a/tests/PHPStan/Rules/Methods/data/misleadingTypehints.php +++ b/tests/PHPStan/Rules/Methods/data/misleadingTypehints.php @@ -1,4 +1,4 @@ -= 8.0 class FooWithoutNamespace { diff --git a/tests/PHPStan/Rules/Methods/data/missing-method-impl-enum.php b/tests/PHPStan/Rules/Methods/data/missing-method-impl-enum.php index 28f00b429ef..a89e7a343f2 100644 --- a/tests/PHPStan/Rules/Methods/data/missing-method-impl-enum.php +++ b/tests/PHPStan/Rules/Methods/data/missing-method-impl-enum.php @@ -1,4 +1,4 @@ -= 8.1 namespace MissingMethodImplEnum; diff --git a/tests/PHPStan/Rules/Methods/data/overriden-abstract-trait-method-phpdoc.php b/tests/PHPStan/Rules/Methods/data/overriden-abstract-trait-method-phpdoc.php index 6a89da78629..5c42d390d11 100644 --- a/tests/PHPStan/Rules/Methods/data/overriden-abstract-trait-method-phpdoc.php +++ b/tests/PHPStan/Rules/Methods/data/overriden-abstract-trait-method-phpdoc.php @@ -1,4 +1,4 @@ -= 8.0 namespace OverridenAbstractTraitMethodPhpDoc; diff --git a/tests/PHPStan/Rules/Methods/data/param-out.php b/tests/PHPStan/Rules/Methods/data/param-out.php index 51df4504bf9..b211e8de11c 100644 --- a/tests/PHPStan/Rules/Methods/data/param-out.php +++ b/tests/PHPStan/Rules/Methods/data/param-out.php @@ -1,4 +1,4 @@ -= 8.0 namespace ParamOutTemplate; diff --git a/tests/PHPStan/Rules/Methods/data/parameter-contravariance.php b/tests/PHPStan/Rules/Methods/data/parameter-contravariance.php index 81d76bed806..1f4cc040eb8 100644 --- a/tests/PHPStan/Rules/Methods/data/parameter-contravariance.php +++ b/tests/PHPStan/Rules/Methods/data/parameter-contravariance.php @@ -1,4 +1,4 @@ -= 8.0 namespace ParameterContravariance; diff --git a/tests/PHPStan/Rules/Methods/data/static-method-call-statement-result-discarded.php b/tests/PHPStan/Rules/Methods/data/static-method-call-statement-result-discarded.php index 7f821ec394b..d717446d7e2 100644 --- a/tests/PHPStan/Rules/Methods/data/static-method-call-statement-result-discarded.php +++ b/tests/PHPStan/Rules/Methods/data/static-method-call-statement-result-discarded.php @@ -1,4 +1,4 @@ -= 8.5 namespace StaticMethodCallStatementResultDiscarded; diff --git a/tests/PHPStan/Rules/Methods/data/tentative-return-types.php b/tests/PHPStan/Rules/Methods/data/tentative-return-types.php index 0471f4a5785..ffad66ccd90 100644 --- a/tests/PHPStan/Rules/Methods/data/tentative-return-types.php +++ b/tests/PHPStan/Rules/Methods/data/tentative-return-types.php @@ -1,4 +1,4 @@ -= 8.0 namespace TentativeReturnTypes; diff --git a/tests/PHPStan/Rules/Operators/data/invalid-binary-mixed.php b/tests/PHPStan/Rules/Operators/data/invalid-binary-mixed.php index edd4eb52b0e..3aaef3e589c 100644 --- a/tests/PHPStan/Rules/Operators/data/invalid-binary-mixed.php +++ b/tests/PHPStan/Rules/Operators/data/invalid-binary-mixed.php @@ -1,4 +1,4 @@ -= 8.0 namespace InvalidBinaryOperatorWithMixed; diff --git a/tests/PHPStan/Rules/Operators/data/invalid-inc-dec-mixed.php b/tests/PHPStan/Rules/Operators/data/invalid-inc-dec-mixed.php index 4e190cc73cd..c8cfbc20789 100644 --- a/tests/PHPStan/Rules/Operators/data/invalid-inc-dec-mixed.php +++ b/tests/PHPStan/Rules/Operators/data/invalid-inc-dec-mixed.php @@ -1,4 +1,4 @@ -= 8.0 namespace InvalidIncDecMixed; diff --git a/tests/PHPStan/Rules/Operators/data/invalid-unary-mixed.php b/tests/PHPStan/Rules/Operators/data/invalid-unary-mixed.php index a82faa213a4..541bb33d28b 100644 --- a/tests/PHPStan/Rules/Operators/data/invalid-unary-mixed.php +++ b/tests/PHPStan/Rules/Operators/data/invalid-unary-mixed.php @@ -1,4 +1,4 @@ -= 8.0 namespace InvalidUnaryMixed; diff --git a/tests/PHPStan/Rules/PhpDoc/data/bug-10861.php b/tests/PHPStan/Rules/PhpDoc/data/bug-10861.php index a9116442b19..4d57f3fbff0 100644 --- a/tests/PHPStan/Rules/PhpDoc/data/bug-10861.php +++ b/tests/PHPStan/Rules/PhpDoc/data/bug-10861.php @@ -1,4 +1,4 @@ -= 8.0 namespace Bug10861; diff --git a/tests/PHPStan/Rules/PhpDoc/data/bug-7310.php b/tests/PHPStan/Rules/PhpDoc/data/bug-7310.php index cab561b15cb..e6e30edfcc4 100644 --- a/tests/PHPStan/Rules/PhpDoc/data/bug-7310.php +++ b/tests/PHPStan/Rules/PhpDoc/data/bug-7310.php @@ -1,4 +1,4 @@ -= 8.0 namespace Bug7310; diff --git a/tests/PHPStan/Rules/PhpDoc/data/method-assert.php b/tests/PHPStan/Rules/PhpDoc/data/method-assert.php index ad07ee066dd..c01b23974a6 100644 --- a/tests/PHPStan/Rules/PhpDoc/data/method-assert.php +++ b/tests/PHPStan/Rules/PhpDoc/data/method-assert.php @@ -1,4 +1,4 @@ -= 8.0 namespace MethodAssert; diff --git a/tests/PHPStan/Rules/PhpDoc/data/param-out.php b/tests/PHPStan/Rules/PhpDoc/data/param-out.php index 5c4da69694e..fcc671f9951 100644 --- a/tests/PHPStan/Rules/PhpDoc/data/param-out.php +++ b/tests/PHPStan/Rules/PhpDoc/data/param-out.php @@ -1,4 +1,4 @@ -= 8.0 namespace ParamOutPhpDocRule; diff --git a/tests/PHPStan/Rules/Properties/data/abstract-hooked-properties-in-class.php b/tests/PHPStan/Rules/Properties/data/abstract-hooked-properties-in-class.php index d035d36810f..6e34e7d45c2 100644 --- a/tests/PHPStan/Rules/Properties/data/abstract-hooked-properties-in-class.php +++ b/tests/PHPStan/Rules/Properties/data/abstract-hooked-properties-in-class.php @@ -1,4 +1,4 @@ -= 8.4 namespace AbstractHookedPropertiesInClass; diff --git a/tests/PHPStan/Rules/Properties/data/abstract-hooked-properties-with-bodies.php b/tests/PHPStan/Rules/Properties/data/abstract-hooked-properties-with-bodies.php index 5ff66fc7a34..6ee933e3852 100644 --- a/tests/PHPStan/Rules/Properties/data/abstract-hooked-properties-with-bodies.php +++ b/tests/PHPStan/Rules/Properties/data/abstract-hooked-properties-with-bodies.php @@ -1,4 +1,4 @@ -= 8.4 namespace AbstractHookedPropertiesWithBodies; diff --git a/tests/PHPStan/Rules/Properties/data/bug-12565.php b/tests/PHPStan/Rules/Properties/data/bug-12565.php index 12fafa74695..5745ff830b6 100755 --- a/tests/PHPStan/Rules/Properties/data/bug-12565.php +++ b/tests/PHPStan/Rules/Properties/data/bug-12565.php @@ -1,4 +1,4 @@ -= 8.0 namespace Bug12565; diff --git a/tests/PHPStan/Rules/Properties/data/bug-12775.php b/tests/PHPStan/Rules/Properties/data/bug-12775.php index bdade366f33..872afa8e1e0 100644 --- a/tests/PHPStan/Rules/Properties/data/bug-12775.php +++ b/tests/PHPStan/Rules/Properties/data/bug-12775.php @@ -1,4 +1,4 @@ -= 8.0 namespace Bug12775; diff --git a/tests/PHPStan/Rules/Properties/data/bug-13537.php b/tests/PHPStan/Rules/Properties/data/bug-13537.php index 44959977324..bfa387b6cb8 100644 --- a/tests/PHPStan/Rules/Properties/data/bug-13537.php +++ b/tests/PHPStan/Rules/Properties/data/bug-13537.php @@ -1,4 +1,4 @@ -= 8.0 namespace Bug13537; diff --git a/tests/PHPStan/Rules/Properties/data/final-property-hooks-in-interface.php b/tests/PHPStan/Rules/Properties/data/final-property-hooks-in-interface.php index 946e8b96ef8..14507c775ba 100644 --- a/tests/PHPStan/Rules/Properties/data/final-property-hooks-in-interface.php +++ b/tests/PHPStan/Rules/Properties/data/final-property-hooks-in-interface.php @@ -1,4 +1,4 @@ -= 8.4 namespace FinalPropertyHooksInInterface; diff --git a/tests/PHPStan/Rules/Properties/data/hooked-properties-in-class.php b/tests/PHPStan/Rules/Properties/data/hooked-properties-in-class.php index 65c27eb50c1..1b91a34874b 100644 --- a/tests/PHPStan/Rules/Properties/data/hooked-properties-in-class.php +++ b/tests/PHPStan/Rules/Properties/data/hooked-properties-in-class.php @@ -1,4 +1,4 @@ -= 8.4 namespace HookedPropertiesInClass; diff --git a/tests/PHPStan/Rules/Properties/data/hooked-properties-without-bodies-in-class.php b/tests/PHPStan/Rules/Properties/data/hooked-properties-without-bodies-in-class.php index 24238e5c14f..688b119b0a6 100644 --- a/tests/PHPStan/Rules/Properties/data/hooked-properties-without-bodies-in-class.php +++ b/tests/PHPStan/Rules/Properties/data/hooked-properties-without-bodies-in-class.php @@ -1,4 +1,4 @@ -= 8.4 namespace HookedPropertiesWithoutBodiesInClass; diff --git a/tests/PHPStan/Rules/Properties/data/intersection-types.php b/tests/PHPStan/Rules/Properties/data/intersection-types.php index 715551fbcff..5afb8fae085 100644 --- a/tests/PHPStan/Rules/Properties/data/intersection-types.php +++ b/tests/PHPStan/Rules/Properties/data/intersection-types.php @@ -1,4 +1,4 @@ -= 8.1 namespace PropertyIntersectionTypes; diff --git a/tests/PHPStan/Rules/Properties/data/non-abstract-hooked-properties-in-abstract-class.php b/tests/PHPStan/Rules/Properties/data/non-abstract-hooked-properties-in-abstract-class.php index a29e8e769de..e255d8b5f3a 100644 --- a/tests/PHPStan/Rules/Properties/data/non-abstract-hooked-properties-in-abstract-class.php +++ b/tests/PHPStan/Rules/Properties/data/non-abstract-hooked-properties-in-abstract-class.php @@ -1,4 +1,4 @@ -= 8.4 namespace NonAbstractHookedPropertiesInAbstractClass; diff --git a/tests/PHPStan/Rules/Properties/data/non-abstract-hooked-properties-in-class.php b/tests/PHPStan/Rules/Properties/data/non-abstract-hooked-properties-in-class.php index 82a779142b1..69b584807c7 100644 --- a/tests/PHPStan/Rules/Properties/data/non-abstract-hooked-properties-in-class.php +++ b/tests/PHPStan/Rules/Properties/data/non-abstract-hooked-properties-in-class.php @@ -1,4 +1,4 @@ -= 8.4 namespace NonAbstractHookedPropertiesInClass; diff --git a/tests/PHPStan/Rules/Properties/data/overriding-final-property.php b/tests/PHPStan/Rules/Properties/data/overriding-final-property.php index b41b531c984..590595c297c 100644 --- a/tests/PHPStan/Rules/Properties/data/overriding-final-property.php +++ b/tests/PHPStan/Rules/Properties/data/overriding-final-property.php @@ -1,4 +1,4 @@ -= 8.4 namespace OverridingFinalProperty; diff --git a/tests/PHPStan/Rules/Properties/data/overriding-property.php b/tests/PHPStan/Rules/Properties/data/overriding-property.php index cf0b46cd4c1..51c56ff6a1e 100644 --- a/tests/PHPStan/Rules/Properties/data/overriding-property.php +++ b/tests/PHPStan/Rules/Properties/data/overriding-property.php @@ -1,4 +1,4 @@ -= 8.1 namespace OverridingProperty; diff --git a/tests/PHPStan/Rules/Properties/data/php-82-dynamic-properties-allow.php b/tests/PHPStan/Rules/Properties/data/php-82-dynamic-properties-allow.php index 9559322bd88..934e3738b83 100644 --- a/tests/PHPStan/Rules/Properties/data/php-82-dynamic-properties-allow.php +++ b/tests/PHPStan/Rules/Properties/data/php-82-dynamic-properties-allow.php @@ -1,4 +1,4 @@ -= 8.0 namespace Php82DynamicPropertiesAllow; diff --git a/tests/PHPStan/Rules/Properties/data/properties-in-interface.php b/tests/PHPStan/Rules/Properties/data/properties-in-interface.php index 4d104487fb7..2cd58d4fa14 100644 --- a/tests/PHPStan/Rules/Properties/data/properties-in-interface.php +++ b/tests/PHPStan/Rules/Properties/data/properties-in-interface.php @@ -1,4 +1,4 @@ -= 8.4 namespace PropertiesInInterface; diff --git a/tests/PHPStan/Rules/Properties/data/property-hooks-bodies-in-interface.php b/tests/PHPStan/Rules/Properties/data/property-hooks-bodies-in-interface.php index 58af100248c..bdb53f98a2f 100644 --- a/tests/PHPStan/Rules/Properties/data/property-hooks-bodies-in-interface.php +++ b/tests/PHPStan/Rules/Properties/data/property-hooks-bodies-in-interface.php @@ -1,4 +1,4 @@ -= 8.4 namespace PropertyHooksBodiesInInterface; diff --git a/tests/PHPStan/Rules/Properties/data/property-hooks-in-interface.php b/tests/PHPStan/Rules/Properties/data/property-hooks-in-interface.php index 3cbaded990e..ab9daf3b6b2 100644 --- a/tests/PHPStan/Rules/Properties/data/property-hooks-in-interface.php +++ b/tests/PHPStan/Rules/Properties/data/property-hooks-in-interface.php @@ -1,4 +1,4 @@ -= 8.4 namespace PropertyHooksInInterface; diff --git a/tests/PHPStan/Rules/Properties/data/property-hooks-visibility-in-interface.php b/tests/PHPStan/Rules/Properties/data/property-hooks-visibility-in-interface.php index cd70c3b5142..3c0e310e9ca 100644 --- a/tests/PHPStan/Rules/Properties/data/property-hooks-visibility-in-interface.php +++ b/tests/PHPStan/Rules/Properties/data/property-hooks-visibility-in-interface.php @@ -1,4 +1,4 @@ -= 8.4 namespace PropertyHooksVisibilityInInterface; diff --git a/tests/PHPStan/Rules/Properties/data/property-in-interface-explicit-abstract.php b/tests/PHPStan/Rules/Properties/data/property-in-interface-explicit-abstract.php index d91986b659b..5013f1084ed 100644 --- a/tests/PHPStan/Rules/Properties/data/property-in-interface-explicit-abstract.php +++ b/tests/PHPStan/Rules/Properties/data/property-in-interface-explicit-abstract.php @@ -1,4 +1,4 @@ -= 8.4 namespace PropertyInInterfaceExplicitAbstract; diff --git a/tests/PHPStan/Rules/Properties/data/read-only-property-phpdoc-and-native.php b/tests/PHPStan/Rules/Properties/data/read-only-property-phpdoc-and-native.php index 3e3c94a909e..9742f8dfc19 100644 --- a/tests/PHPStan/Rules/Properties/data/read-only-property-phpdoc-and-native.php +++ b/tests/PHPStan/Rules/Properties/data/read-only-property-phpdoc-and-native.php @@ -1,4 +1,4 @@ -= 8.1 namespace ReadOnlyPropertyAndNative; diff --git a/tests/PHPStan/Rules/Properties/data/read-only-property.php b/tests/PHPStan/Rules/Properties/data/read-only-property.php index 20cc6d1c0f0..c667795f71d 100644 --- a/tests/PHPStan/Rules/Properties/data/read-only-property.php +++ b/tests/PHPStan/Rules/Properties/data/read-only-property.php @@ -1,4 +1,4 @@ -= 8.1 namespace ReadOnlyProperty; diff --git a/tests/PHPStan/Rules/Properties/data/readonly-property-hooks-in-interface.php b/tests/PHPStan/Rules/Properties/data/readonly-property-hooks-in-interface.php index 53aa244fa9f..7e4da6cbaf8 100644 --- a/tests/PHPStan/Rules/Properties/data/readonly-property-hooks-in-interface.php +++ b/tests/PHPStan/Rules/Properties/data/readonly-property-hooks-in-interface.php @@ -1,4 +1,4 @@ -= 8.4 namespace ReadonlyPropertyHooksInInterface; diff --git a/tests/PHPStan/Rules/Properties/data/readonly-property-hooks.php b/tests/PHPStan/Rules/Properties/data/readonly-property-hooks.php index f97afbb5429..f9381be2ea2 100644 --- a/tests/PHPStan/Rules/Properties/data/readonly-property-hooks.php +++ b/tests/PHPStan/Rules/Properties/data/readonly-property-hooks.php @@ -1,4 +1,4 @@ -= 8.4 namespace ReadonlyPropertyHooks; diff --git a/tests/PHPStan/Rules/Properties/data/set-property-hook-parameter.php b/tests/PHPStan/Rules/Properties/data/set-property-hook-parameter.php index 12c82ddc0af..f1c9a681b64 100644 --- a/tests/PHPStan/Rules/Properties/data/set-property-hook-parameter.php +++ b/tests/PHPStan/Rules/Properties/data/set-property-hook-parameter.php @@ -1,4 +1,4 @@ -= 8.4 namespace SetPropertyHookParameter; diff --git a/tests/PHPStan/Rules/Properties/data/static-hooked-properties.php b/tests/PHPStan/Rules/Properties/data/static-hooked-properties.php index 101f4b3b280..3a71760ff38 100644 --- a/tests/PHPStan/Rules/Properties/data/static-hooked-properties.php +++ b/tests/PHPStan/Rules/Properties/data/static-hooked-properties.php @@ -1,4 +1,4 @@ -= 8.4 namespace StaticHookedProperties; diff --git a/tests/PHPStan/Rules/Properties/data/static-hooked-property-in-interface.php b/tests/PHPStan/Rules/Properties/data/static-hooked-property-in-interface.php index 66f45edf785..98704830cea 100644 --- a/tests/PHPStan/Rules/Properties/data/static-hooked-property-in-interface.php +++ b/tests/PHPStan/Rules/Properties/data/static-hooked-property-in-interface.php @@ -1,4 +1,4 @@ -= 8.4 namespace StaticHookedPropertyInInterface; diff --git a/tests/PHPStan/Rules/Properties/data/virtual-hooked-properties.php b/tests/PHPStan/Rules/Properties/data/virtual-hooked-properties.php index 4c69f70d60e..d2c72df3c35 100644 --- a/tests/PHPStan/Rules/Properties/data/virtual-hooked-properties.php +++ b/tests/PHPStan/Rules/Properties/data/virtual-hooked-properties.php @@ -1,4 +1,4 @@ -= 8.4 namespace VirtualHookedProperties; diff --git a/tests/PHPStan/Rules/Pure/data/all-methods-are-pure.php b/tests/PHPStan/Rules/Pure/data/all-methods-are-pure.php index 03ee1cf0888..4ba6363e9f1 100644 --- a/tests/PHPStan/Rules/Pure/data/all-methods-are-pure.php +++ b/tests/PHPStan/Rules/Pure/data/all-methods-are-pure.php @@ -1,4 +1,4 @@ -= 8.0 namespace AllMethodsArePure; diff --git a/tests/PHPStan/Rules/Pure/data/bug-12224.php b/tests/PHPStan/Rules/Pure/data/bug-12224.php index b93de831788..c2ff8445ac3 100644 --- a/tests/PHPStan/Rules/Pure/data/bug-12224.php +++ b/tests/PHPStan/Rules/Pure/data/bug-12224.php @@ -1,4 +1,4 @@ -= 8.0 namespace PHPStan\Rules\Pure\data; diff --git a/tests/PHPStan/Rules/Pure/data/bug-14511-method.php b/tests/PHPStan/Rules/Pure/data/bug-14511-method.php index 5b8b15030a5..d4408191524 100644 --- a/tests/PHPStan/Rules/Pure/data/bug-14511-method.php +++ b/tests/PHPStan/Rules/Pure/data/bug-14511-method.php @@ -1,4 +1,4 @@ -= 8.0 namespace Bug14511Method; diff --git a/tests/PHPStan/Rules/Pure/data/bug-14511.php b/tests/PHPStan/Rules/Pure/data/bug-14511.php index 72569f7799a..2c0218abdaf 100644 --- a/tests/PHPStan/Rules/Pure/data/bug-14511.php +++ b/tests/PHPStan/Rules/Pure/data/bug-14511.php @@ -1,4 +1,4 @@ -= 8.0 namespace Bug14511; diff --git a/tests/PHPStan/Rules/Pure/data/pure-function.php b/tests/PHPStan/Rules/Pure/data/pure-function.php index 295e0c364d1..6b98d65b37e 100644 --- a/tests/PHPStan/Rules/Pure/data/pure-function.php +++ b/tests/PHPStan/Rules/Pure/data/pure-function.php @@ -1,4 +1,4 @@ -= 8.0 namespace PureFunction; diff --git a/tests/PHPStan/Rules/TooWideTypehints/data/bug-6158.php b/tests/PHPStan/Rules/TooWideTypehints/data/bug-6158.php index 0bcc2f80df4..6092ae24caf 100644 --- a/tests/PHPStan/Rules/TooWideTypehints/data/bug-6158.php +++ b/tests/PHPStan/Rules/TooWideTypehints/data/bug-6158.php @@ -1,4 +1,4 @@ -= 8.0 namespace Bug6158; diff --git a/tests/PHPStan/Rules/Traits/data/conflicting-trait-constants-types.php b/tests/PHPStan/Rules/Traits/data/conflicting-trait-constants-types.php index eaa130ffeb0..cb74427de1c 100644 --- a/tests/PHPStan/Rules/Traits/data/conflicting-trait-constants-types.php +++ b/tests/PHPStan/Rules/Traits/data/conflicting-trait-constants-types.php @@ -1,4 +1,4 @@ -= 8.3 namespace ConflictingTraitConstantsTypes; diff --git a/tests/PHPStan/Rules/Types/data/invalid-union-with-mixed.php b/tests/PHPStan/Rules/Types/data/invalid-union-with-mixed.php index 2db7a96193d..cd980be9776 100644 --- a/tests/PHPStan/Rules/Types/data/invalid-union-with-mixed.php +++ b/tests/PHPStan/Rules/Types/data/invalid-union-with-mixed.php @@ -1,4 +1,4 @@ -= 8.0 namespace InvalidUnionWithMixed; diff --git a/tests/PHPStan/Rules/Variables/data/bug-12754.php b/tests/PHPStan/Rules/Variables/data/bug-12754.php index e8269ff4d02..5c3038d03fa 100644 --- a/tests/PHPStan/Rules/Variables/data/bug-12754.php +++ b/tests/PHPStan/Rules/Variables/data/bug-12754.php @@ -1,4 +1,4 @@ -= 8.0 namespace Bug12754; diff --git a/tests/PHPStan/Rules/Variables/data/bug-14352.php b/tests/PHPStan/Rules/Variables/data/bug-14352.php index 60f16d65445..4e47b5e6a81 100644 --- a/tests/PHPStan/Rules/Variables/data/bug-14352.php +++ b/tests/PHPStan/Rules/Variables/data/bug-14352.php @@ -1,4 +1,4 @@ -= 8.0 namespace Bug14352; diff --git a/tests/PHPStan/Rules/Variables/data/bug-4204.php b/tests/PHPStan/Rules/Variables/data/bug-4204.php index bb822b43170..a21bdf580c3 100644 --- a/tests/PHPStan/Rules/Variables/data/bug-4204.php +++ b/tests/PHPStan/Rules/Variables/data/bug-4204.php @@ -1,4 +1,4 @@ -= 8.0 namespace Bug4204; diff --git a/tests/PHPStan/Rules/Variables/data/bug-nullCoalesceMultiDimLoop.php b/tests/PHPStan/Rules/Variables/data/bug-nullCoalesceMultiDimLoop.php index 952a3ac9da2..8bd54ee7d9a 100644 --- a/tests/PHPStan/Rules/Variables/data/bug-nullCoalesceMultiDimLoop.php +++ b/tests/PHPStan/Rules/Variables/data/bug-nullCoalesceMultiDimLoop.php @@ -1,4 +1,4 @@ -= 8.0 namespace BugNullCoalesceMultiDimLoop;