Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6c91073

Browse files
committed
minor #52544 [Routing] Extend old Annotations from new Attributes (curry684)
This PR was squashed before being merged into the 6.4 branch. Discussion ---------- [Routing] Extend old Annotations from new Attributes If the base class is missing PHPStan fails to recognize the aliasing correctly. | Q | A | ------------- | --- | Branch? | 6.4 | Bug fix? | sort of | New feature? | no | Deprecations? | no | License | MIT Due to a shortcoming in PHPStan it does not pick up the previous aliasing correctly (ref. https://phpstan.org/r/2c7a9166-e8e1-42e5-8448-54c7d814e7d9). This will cause projects to start failing their static analysis when they upgrade to 6.4. Explicitly extending the new attribute in the Attribute namespace has no runtime impact and shuts up PHPStan. Commits ------- 2d9eb7b [Routing] Extend old Annotations from new Attributes
2 parents a3df74a + 2d9eb7b commit 6c91073

File tree

16 files changed

+27
-11
lines changed

16 files changed

+27
-11
lines changed

src/Symfony/Component/Routing/Annotation/Route.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class_exists(\Symfony\Component\Routing\Attribute\Route::class);
1717

1818
if (false) {
1919
#[\Attribute(\Attribute::IS_REPEATABLE | \Attribute::TARGET_CLASS | \Attribute::TARGET_METHOD)]
20-
class Route
20+
class Route extends \Symfony\Component\Routing\Attribute\Route
2121
{
2222
}
2323
}

src/Symfony/Component/Routing/Attribute/Route.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
*
2121
* @author Fabien Potencier <[email protected]>
2222
* @author Alexander M. Turek <[email protected]>
23+
*
24+
* @final since Symfony 6.4
2325
*/
2426
#[\Attribute(\Attribute::IS_REPEATABLE | \Attribute::TARGET_CLASS | \Attribute::TARGET_METHOD)]
2527
class Route

src/Symfony/Component/Serializer/Annotation/Context.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class_exists(\Symfony\Component\Serializer\Attribute\Context::class);
1717

1818
if (false) {
1919
#[\Attribute(\Attribute::TARGET_CLASS | \Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)]
20-
class Context
20+
class Context extends \Symfony\Component\Serializer\Attribute\Context
2121
{
2222
}
2323
}

src/Symfony/Component/Serializer/Annotation/DiscriminatorMap.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class_exists(\Symfony\Component\Serializer\Attribute\DiscriminatorMap::class);
1515

1616
if (false) {
1717
#[\Attribute(\Attribute::TARGET_CLASS)]
18-
class DiscriminatorMap
18+
class DiscriminatorMap extends \Symfony\Component\Serializer\Attribute\DiscriminatorMap
1919
{
2020
}
2121
}

src/Symfony/Component/Serializer/Annotation/Groups.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class_exists(\Symfony\Component\Serializer\Attribute\Groups::class);
1515

1616
if (false) {
1717
#[\Attribute(\Attribute::TARGET_METHOD | \Attribute::TARGET_PROPERTY | \Attribute::TARGET_CLASS)]
18-
class Groups
18+
class Groups extends \Symfony\Component\Serializer\Attribute\Groups
1919
{
2020
}
2121
}

src/Symfony/Component/Serializer/Annotation/Ignore.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class_exists(\Symfony\Component\Serializer\Attribute\Ignore::class);
1515

1616
if (false) {
1717
#[\Attribute(\Attribute::TARGET_METHOD | \Attribute::TARGET_PROPERTY)]
18-
final class Ignore
18+
class Ignore extends \Symfony\Component\Serializer\Attribute\Ignore
1919
{
2020
}
2121
}

src/Symfony/Component/Serializer/Annotation/MaxDepth.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class_exists(\Symfony\Component\Serializer\Attribute\MaxDepth::class);
1515

1616
if (false) {
1717
#[\Attribute(\Attribute::TARGET_METHOD | \Attribute::TARGET_PROPERTY)]
18-
class MaxDepth
18+
class MaxDepth extends \Symfony\Component\Serializer\Attribute\MaxDepth
1919
{
2020
}
2121
}

src/Symfony/Component/Serializer/Annotation/SerializedName.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class_exists(\Symfony\Component\Serializer\Attribute\SerializedName::class);
1515

1616
if (false) {
1717
#[\Attribute(\Attribute::TARGET_METHOD | \Attribute::TARGET_PROPERTY)]
18-
final class SerializedName
18+
class SerializedName extends \Symfony\Component\Serializer\Attribute\SerializedName
1919
{
2020
}
2121
}

src/Symfony/Component/Serializer/Annotation/SerializedPath.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class_exists(\Symfony\Component\Serializer\Attribute\SerializedPath::class);
1515

1616
if (false) {
1717
#[\Attribute(\Attribute::TARGET_METHOD | \Attribute::TARGET_PROPERTY)]
18-
final class SerializedPath
18+
class SerializedPath extends \Symfony\Component\Serializer\Attribute\SerializedPath
1919
{
2020
}
2121
}

src/Symfony/Component/Serializer/Attribute/Context.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
* @Target({"PROPERTY", "METHOD"})
2222
*
2323
* @author Maxime Steinhausser <[email protected]>
24+
*
25+
* @final since Symfony 6.4
2426
*/
2527
#[\Attribute(\Attribute::TARGET_CLASS | \Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)]
2628
class Context

0 commit comments

Comments
 (0)