From 2d9eb7b0726fac07a9dcacf5eb0a1c3ca116178c Mon Sep 17 00:00:00 2001 From: Niels Keurentjes Date: Fri, 10 Nov 2023 16:54:38 +0100 Subject: [PATCH] [Routing] Extend old Annotations from new Attributes --- src/Symfony/Component/Routing/Annotation/Route.php | 2 +- src/Symfony/Component/Routing/Attribute/Route.php | 2 ++ src/Symfony/Component/Serializer/Annotation/Context.php | 2 +- .../Component/Serializer/Annotation/DiscriminatorMap.php | 2 +- src/Symfony/Component/Serializer/Annotation/Groups.php | 2 +- src/Symfony/Component/Serializer/Annotation/Ignore.php | 2 +- src/Symfony/Component/Serializer/Annotation/MaxDepth.php | 2 +- .../Component/Serializer/Annotation/SerializedName.php | 2 +- .../Component/Serializer/Annotation/SerializedPath.php | 2 +- src/Symfony/Component/Serializer/Attribute/Context.php | 2 ++ .../Component/Serializer/Attribute/DiscriminatorMap.php | 2 ++ src/Symfony/Component/Serializer/Attribute/Groups.php | 2 ++ src/Symfony/Component/Serializer/Attribute/Ignore.php | 4 +++- src/Symfony/Component/Serializer/Attribute/MaxDepth.php | 2 ++ src/Symfony/Component/Serializer/Attribute/SerializedName.php | 4 +++- src/Symfony/Component/Serializer/Attribute/SerializedPath.php | 4 +++- 16 files changed, 27 insertions(+), 11 deletions(-) diff --git a/src/Symfony/Component/Routing/Annotation/Route.php b/src/Symfony/Component/Routing/Annotation/Route.php index 5c497fc281422..dda3bdaded528 100644 --- a/src/Symfony/Component/Routing/Annotation/Route.php +++ b/src/Symfony/Component/Routing/Annotation/Route.php @@ -17,7 +17,7 @@ class_exists(\Symfony\Component\Routing\Attribute\Route::class); if (false) { #[\Attribute(\Attribute::IS_REPEATABLE | \Attribute::TARGET_CLASS | \Attribute::TARGET_METHOD)] - class Route + class Route extends \Symfony\Component\Routing\Attribute\Route { } } diff --git a/src/Symfony/Component/Routing/Attribute/Route.php b/src/Symfony/Component/Routing/Attribute/Route.php index 398a4dd70d9b4..0077f76db67bd 100644 --- a/src/Symfony/Component/Routing/Attribute/Route.php +++ b/src/Symfony/Component/Routing/Attribute/Route.php @@ -20,6 +20,8 @@ * * @author Fabien Potencier * @author Alexander M. Turek + * + * @final since Symfony 6.4 */ #[\Attribute(\Attribute::IS_REPEATABLE | \Attribute::TARGET_CLASS | \Attribute::TARGET_METHOD)] class Route diff --git a/src/Symfony/Component/Serializer/Annotation/Context.php b/src/Symfony/Component/Serializer/Annotation/Context.php index eef8331481f75..962169788e50d 100644 --- a/src/Symfony/Component/Serializer/Annotation/Context.php +++ b/src/Symfony/Component/Serializer/Annotation/Context.php @@ -17,7 +17,7 @@ class_exists(\Symfony\Component\Serializer\Attribute\Context::class); if (false) { #[\Attribute(\Attribute::TARGET_CLASS | \Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] - class Context + class Context extends \Symfony\Component\Serializer\Attribute\Context { } } diff --git a/src/Symfony/Component/Serializer/Annotation/DiscriminatorMap.php b/src/Symfony/Component/Serializer/Annotation/DiscriminatorMap.php index 89b2ae9e8e20f..c1a3021ded536 100644 --- a/src/Symfony/Component/Serializer/Annotation/DiscriminatorMap.php +++ b/src/Symfony/Component/Serializer/Annotation/DiscriminatorMap.php @@ -15,7 +15,7 @@ class_exists(\Symfony\Component\Serializer\Attribute\DiscriminatorMap::class); if (false) { #[\Attribute(\Attribute::TARGET_CLASS)] - class DiscriminatorMap + class DiscriminatorMap extends \Symfony\Component\Serializer\Attribute\DiscriminatorMap { } } diff --git a/src/Symfony/Component/Serializer/Annotation/Groups.php b/src/Symfony/Component/Serializer/Annotation/Groups.php index 89338b05ccb57..642626f7fced8 100644 --- a/src/Symfony/Component/Serializer/Annotation/Groups.php +++ b/src/Symfony/Component/Serializer/Annotation/Groups.php @@ -15,7 +15,7 @@ class_exists(\Symfony\Component\Serializer\Attribute\Groups::class); if (false) { #[\Attribute(\Attribute::TARGET_METHOD | \Attribute::TARGET_PROPERTY | \Attribute::TARGET_CLASS)] - class Groups + class Groups extends \Symfony\Component\Serializer\Attribute\Groups { } } diff --git a/src/Symfony/Component/Serializer/Annotation/Ignore.php b/src/Symfony/Component/Serializer/Annotation/Ignore.php index 219ea725b52c5..178eb4e6b0abe 100644 --- a/src/Symfony/Component/Serializer/Annotation/Ignore.php +++ b/src/Symfony/Component/Serializer/Annotation/Ignore.php @@ -15,7 +15,7 @@ class_exists(\Symfony\Component\Serializer\Attribute\Ignore::class); if (false) { #[\Attribute(\Attribute::TARGET_METHOD | \Attribute::TARGET_PROPERTY)] - final class Ignore + class Ignore extends \Symfony\Component\Serializer\Attribute\Ignore { } } diff --git a/src/Symfony/Component/Serializer/Annotation/MaxDepth.php b/src/Symfony/Component/Serializer/Annotation/MaxDepth.php index 591e68ed95c21..ee1bc1ae79827 100644 --- a/src/Symfony/Component/Serializer/Annotation/MaxDepth.php +++ b/src/Symfony/Component/Serializer/Annotation/MaxDepth.php @@ -15,7 +15,7 @@ class_exists(\Symfony\Component\Serializer\Attribute\MaxDepth::class); if (false) { #[\Attribute(\Attribute::TARGET_METHOD | \Attribute::TARGET_PROPERTY)] - class MaxDepth + class MaxDepth extends \Symfony\Component\Serializer\Attribute\MaxDepth { } } diff --git a/src/Symfony/Component/Serializer/Annotation/SerializedName.php b/src/Symfony/Component/Serializer/Annotation/SerializedName.php index 97c6e0aec2143..167064a0b9d17 100644 --- a/src/Symfony/Component/Serializer/Annotation/SerializedName.php +++ b/src/Symfony/Component/Serializer/Annotation/SerializedName.php @@ -15,7 +15,7 @@ class_exists(\Symfony\Component\Serializer\Attribute\SerializedName::class); if (false) { #[\Attribute(\Attribute::TARGET_METHOD | \Attribute::TARGET_PROPERTY)] - final class SerializedName + class SerializedName extends \Symfony\Component\Serializer\Attribute\SerializedName { } } diff --git a/src/Symfony/Component/Serializer/Annotation/SerializedPath.php b/src/Symfony/Component/Serializer/Annotation/SerializedPath.php index f555a1086ac95..76e4c7eff2c5c 100644 --- a/src/Symfony/Component/Serializer/Annotation/SerializedPath.php +++ b/src/Symfony/Component/Serializer/Annotation/SerializedPath.php @@ -15,7 +15,7 @@ class_exists(\Symfony\Component\Serializer\Attribute\SerializedPath::class); if (false) { #[\Attribute(\Attribute::TARGET_METHOD | \Attribute::TARGET_PROPERTY)] - final class SerializedPath + class SerializedPath extends \Symfony\Component\Serializer\Attribute\SerializedPath { } } diff --git a/src/Symfony/Component/Serializer/Attribute/Context.php b/src/Symfony/Component/Serializer/Attribute/Context.php index baa958839780d..d62c43046a2e3 100644 --- a/src/Symfony/Component/Serializer/Attribute/Context.php +++ b/src/Symfony/Component/Serializer/Attribute/Context.php @@ -21,6 +21,8 @@ * @Target({"PROPERTY", "METHOD"}) * * @author Maxime Steinhausser + * + * @final since Symfony 6.4 */ #[\Attribute(\Attribute::TARGET_CLASS | \Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class Context diff --git a/src/Symfony/Component/Serializer/Attribute/DiscriminatorMap.php b/src/Symfony/Component/Serializer/Attribute/DiscriminatorMap.php index 4c1f23722eb52..7bba10ab036a6 100644 --- a/src/Symfony/Component/Serializer/Attribute/DiscriminatorMap.php +++ b/src/Symfony/Component/Serializer/Attribute/DiscriminatorMap.php @@ -21,6 +21,8 @@ * @Target({"CLASS"}) * * @author Samuel Roze + * + * @final since Symfony 6.4 */ #[\Attribute(\Attribute::TARGET_CLASS)] class DiscriminatorMap diff --git a/src/Symfony/Component/Serializer/Attribute/Groups.php b/src/Symfony/Component/Serializer/Attribute/Groups.php index 9a351910aed57..386a2ce00bd2d 100644 --- a/src/Symfony/Component/Serializer/Attribute/Groups.php +++ b/src/Symfony/Component/Serializer/Attribute/Groups.php @@ -21,6 +21,8 @@ * @Target({"PROPERTY", "METHOD", "CLASS"}) * * @author Kévin Dunglas + * + * @final since Symfony 6.4 */ #[\Attribute(\Attribute::TARGET_METHOD | \Attribute::TARGET_PROPERTY | \Attribute::TARGET_CLASS)] class Groups diff --git a/src/Symfony/Component/Serializer/Attribute/Ignore.php b/src/Symfony/Component/Serializer/Attribute/Ignore.php index 688a1f3f44451..577a77084326b 100644 --- a/src/Symfony/Component/Serializer/Attribute/Ignore.php +++ b/src/Symfony/Component/Serializer/Attribute/Ignore.php @@ -18,9 +18,11 @@ * @Target({"PROPERTY", "METHOD"}) * * @author Kévin Dunglas + * + * @final since Symfony 6.4 */ #[\Attribute(\Attribute::TARGET_METHOD | \Attribute::TARGET_PROPERTY)] -final class Ignore +class Ignore { } diff --git a/src/Symfony/Component/Serializer/Attribute/MaxDepth.php b/src/Symfony/Component/Serializer/Attribute/MaxDepth.php index 3ecfcb993755d..bbd190ccfaa9b 100644 --- a/src/Symfony/Component/Serializer/Attribute/MaxDepth.php +++ b/src/Symfony/Component/Serializer/Attribute/MaxDepth.php @@ -21,6 +21,8 @@ * @Target({"PROPERTY", "METHOD"}) * * @author Kévin Dunglas + * + * @final since Symfony 6.4 */ #[\Attribute(\Attribute::TARGET_METHOD | \Attribute::TARGET_PROPERTY)] class MaxDepth diff --git a/src/Symfony/Component/Serializer/Attribute/SerializedName.php b/src/Symfony/Component/Serializer/Attribute/SerializedName.php index a2651282fc08d..2afd8d9ed1f8e 100644 --- a/src/Symfony/Component/Serializer/Attribute/SerializedName.php +++ b/src/Symfony/Component/Serializer/Attribute/SerializedName.php @@ -21,9 +21,11 @@ * @Target({"PROPERTY", "METHOD"}) * * @author Fabien Bourigault + * + * @final since Symfony 6.4 */ #[\Attribute(\Attribute::TARGET_METHOD | \Attribute::TARGET_PROPERTY)] -final class SerializedName +class SerializedName { public function __construct(private readonly string $serializedName) { diff --git a/src/Symfony/Component/Serializer/Attribute/SerializedPath.php b/src/Symfony/Component/Serializer/Attribute/SerializedPath.php index 0e5f040876555..eed46c5185a61 100644 --- a/src/Symfony/Component/Serializer/Attribute/SerializedPath.php +++ b/src/Symfony/Component/Serializer/Attribute/SerializedPath.php @@ -23,9 +23,11 @@ * @Target({"PROPERTY", "METHOD"}) * * @author Tobias Bönner + * + * @final since Symfony 6.4 */ #[\Attribute(\Attribute::TARGET_METHOD | \Attribute::TARGET_PROPERTY)] -final class SerializedPath +class SerializedPath { private PropertyPath $serializedPath;