-
Notifications
You must be signed in to change notification settings - Fork 68
Changed private to protected for the ResetPasswordRequestTrait #216
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
The private access modifier could prevent classes from having a level of inheritance. Changing this modifier to protected will allow doctrine to pick up the properties in inherited classes.
Do you mean, if you use Doctrine entity inheritance - Doctrine does not see those private fields from mapped superclass? |
Precisely, if a mapped superclass uses the |
Hm, changes make sense probably. But to clarify, you can just use that |
Yes but it requires unnecessary changes when you have a multi-level inheritance group for users. Changing private to protected makes sure all users will have necessary properties for the reset to work. |
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.
OK, this sounds Like a valid case for me, but let's see what other things
Thank you for sharing some thoughts on it.
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.
Thanks for the contribution @DavidBilodeau1 - I'm a bit hesitant to approve this simply because once we change the visibility from private
-> protected
; it would take a major release to reduce the visibility again for any unforeseen circumstances.
Having said that, I definitely understand your use case for the change and I would most likely submit a PR if I was in your shoes. But, I'm also thinking about the majority of consumers that, I suspect, do not have multiple user entities that need reset functionality. Going along those lines, as @bocharsky-bw said previously, adding use ResetPasswordRequestTrait
to request entities that implement the ResetPasswordRequestInterface
is still doable without this change.
@weaverryan Thoughts?
Because this code is in a trait, even private methods are already accessible to the end-user. So we're already in a different situation than in a normal class (where Also, as an example, So 👍 from me |
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.
Good point Ryan. Thanks again @DavidBilodeau1
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.
on:
push:
branches: ['main']
pull_request:
schedule:
- cron: '0 */12 * * *'
jobs:
static-analysis:
name: Static Analysis
The private access modifier could prevent classes from having a level of inheritance. Changing this modifier to protected will allow doctrine to pick up the properties in inherited classes.