Skip to content
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

allow int enum to be normalized as int #216

Merged
merged 1 commit into from
Feb 20, 2023
Merged

Conversation

maximecolin
Copy link
Member

No description provided.

@maximecolin maximecolin self-assigned this Feb 20, 2023
@maximecolin maximecolin requested a review from benji07 February 20, 2023 10:07
@@ -27,8 +27,10 @@ class EnumNormalizer implements NormalizerInterface, DenormalizerInterface
* {@inheritdoc}
*
* @param EnumInterface $object
*
* @return string|int
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* @return string|int
* @return mixed

Peut être voir si on peux mettre des générics phpstan ici ( en mettant le param EnumInterface et return T)

Copy link
Member

@ogizanagi ogizanagi Feb 20, 2023

Choose a reason for hiding this comment

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

I don't think it'll works here, since we have no way to indicate the template type.
It works when extending a base class defining a template. I'm not sure it's valid as is.

At least it misses @template T of int|string ?

@ogizanagi
Copy link
Member

Thanks Maxime.

@ogizanagi ogizanagi merged commit f4a08aa into 1.x Feb 20, 2023
@ogizanagi ogizanagi deleted the maximecolin-patch-1 branch February 20, 2023 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants