-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Security] AccountStatusException::$user should be nullable #44259
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
[Security] AccountStatusException::$user should be nullable #44259
Conversation
Hey! I see that this is your first PR. That is great! Welcome! Symfony has a contribution guide which I suggest you to read. In short:
Review the GitHub status checks of your pull request and try to solve the reported issues. If some tests are failing, try to see if they are failing because of this change. When two Symfony core team members approve this change, it will be merged and you will become an official Symfony contributor! I am going to sit back now and wait for the reviews. Cheers! Carsonbot |
Hey! I think @rfaivre has recently worked with this code. Maybe they can help review this? Cheers! Carsonbot |
Changing the public API looks wrong to me. Your child class should call |
The type declaration has been removed from the 6.0 branch already which also explains the merge conflict, GitHub reports. @nicolas-grekas I think, this error is raised if we attempt to serialize an instance of this class without setting a user. The instance would kind-of be in an invalid state without the user, but the error message that is triggered is probably not helpful. |
the error also happens if someone calls the getter on an exception on which the setter has not been called. |
Yes. And this basically tells us that the I think, we have two options here:
Either way, on 6.1 we would need to fix the serialization. I don't think that we should rais an exception when serializing/deserializing this class, even if it's in an invalid state. |
…eption:: property
Thank you @acantepie. |
This PR fix error when throw an excepion extending
AccountStatusException
(CustomUserMessageAccountStatusException
for example)