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

Skip to content

[Serializer] GetSetMethodNormalizer: fix BC break with #[Ignore] attribute #53414

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

nikophil
Copy link
Contributor

@nikophil nikophil commented Jan 4, 2024

Q A
Branch? 6.4
Bug fix? yes
New feature? no
Deprecations? no
License MIT

This PR fixes a subtle BC break introduced by https://github.com/symfony/symfony/pull/52294/files: GetSetMethodNormalizer no more ignores methods marked as #[Ignore] with the old class Symfony\Component\Serializer\Annotation\Ignore

@nikophil nikophil requested a review from dunglas as a code owner January 4, 2024 13:46
@carsonbot carsonbot added this to the 6.4 milestone Jan 4, 2024
@OskarStark OskarStark changed the title [Serializer] GetSetMethodNormalize: fix BC break with Ignore attribute [Serializer] GetSetMethodNormalizer: fix BC break with #[Ignore] attribute Jan 4, 2024
@@ -97,7 +97,7 @@ private function supports(string $class): bool
private function isGetMethod(\ReflectionMethod $method): bool
{
return !$method->isStatic()
&& !$method->getAttributes(Ignore::class)
&& !$method->getAttributes(Ignore::class, \ReflectionAttribute::IS_INSTANCEOF)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it'd be better to check the LegacyIgnore attribute directly instead of opening the attribute to inheritance (which opens to a potentially infinite number of child attributes)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@nikophil nikophil force-pushed the serializer/fix-bc-break-ignore-attribute branch from ccded1a to ab42c55 Compare January 5, 2024 09:57
@nicolas-grekas
Copy link
Member

Thank you @nikophil.

@nicolas-grekas nicolas-grekas merged commit 635afca into symfony:6.4 Jan 5, 2024
This was referenced Jan 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants