-
Notifications
You must be signed in to change notification settings - Fork 67
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
Update PHP coding standards to avoid using self
#486
Comments
Is there an actual issue that got cause by this? e.g. Did we have a scenario where we called |
Yes. I'll link you the slack thread. |
This was referenced Jun 5, 2024
Merged
This was referenced Jun 5, 2024
GuySartorelli
changed the title
Update PHP coding standards to avoid calling static methods with
Update PHP coding standards to avoid using Jun 16, 2024
self
self
PRs merged. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
We had a bug which it turned out was caused by an unexpected interaction between
self
and late static binding (see this PR).This was raised in php-src where the response was that it was working as intended.
Going forward we should avoid calling static methods from
self
to avoid this class of bug.Notes
self
altogether, rather than only avoiding it for calling methodsAcceptance Criteria
self
(e.g.self::get()
)self
static
is fine, because it explicitly uses late static binding anywayself
in our codebase are updated to use the actual class that is intended to received the call.self::class::myMethod()
in traitsCode writing script
Kitchen sink CI
PRs
The text was updated successfully, but these errors were encountered: