Skip to content

[Serializer] Introduce template type for NormalizerInterface and DenormalizerInterface #61274

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

Open
wants to merge 1 commit into
base: 7.4
Choose a base branch
from

Conversation

VincentLanglet
Copy link
Contributor

Q A
Branch? 7.4
Bug fix? no
New feature? no
Deprecations? no
Issues Fix #...
License MIT

This is pretty similar to #49033

This allows this https://phpstan.org/r/262f4a17-8075-48be-b3d6-50ce3c9402b2

@VincentLanglet VincentLanglet requested a review from dunglas as a code owner July 30, 2025 13:08
@carsonbot carsonbot added this to the 7.4 milestone Jul 30, 2025
@OskarStark OskarStark changed the title [Serializer] Introduce template type for Normalizer interface [Serializer] Introduce template type for NormalizerInterface and DenormalizerInterface Jul 30, 2025
@Kocal
Copy link
Member

Kocal commented Aug 2, 2025

If I'm not wrong, in userland PHPStan will report that classes implementing NormalizerInterface and DenormalizerInterface will have to specify @implements with correct types.

Is it considered as a BC or its fine, since it only "break" analysis tools and not the code at runtime itself?

@VincentLanglet
Copy link
Contributor Author

If I'm not wrong, in userland PHPStan will report that classes implementing NormalizerInterface and DenormalizerInterface will have to specify @implements with correct types.

Yes, but this is a classic behavior when using libraries with static analysis, bumping patch/minor might introduce new warning ; also Phpstan offers a config option to ignore some classes for such errors.

Is it considered as a BC or its fine, since it only "break" analysis tools and not the code at runtime itself?

This is considered as backward compatible, and such changes has already been merged in minor version (the Voter Pr is an example).

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
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy