Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[Serializer] backed enum throw notNormalizableValueException outside construct method#50192
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
897da96 to53fd29dCompare
TerjeBr left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Looks good, but missing all the data in the NotNormalizableValueException that makes it useful.
src/Symfony/Component/Serializer/Normalizer/BackedEnumNormalizer.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
…n a backedEnum in construct method
53fd29d to5549493Compare
TerjeBr left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Looks good to me
fabpot commentedMay 5, 2023
Thank you@alli83. |
Uh oh!
There was an error while loading.Please reload this page.
PR#47128 (comment) was aiming to throw an InvalidArgumentException if a constructor's argument is not a valid backedEnum( knowing an error will be thrown in all case e.g when it will be instantiated).
This PR aims to throw a NotNormalizableValueException (like it was the case before) if an error occurs on an BackedEnum outside the case of the first PR
So we have two different types of exceptions depending on whether it's an error at the constructor level or not.