-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Added ReflectionMethod::hasPrototype method #8487
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
One last thing is needed before merging: an entry in the UPGRADING file |
Yeah, but that should be done by the person who actually merges (to avoid merge conflicts). Also, should have an entry in NEWS additionally. I'd wait a while, though, just in case anybody objects to adding this method. |
Yeah, I'm aware this, but I thought that we can quickly merge the PR. But you are right, it's better to wait a couple of days just to make sure. |
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.
I don't really understand what prototype is meant to mean here. Does it mean the parent has an implementation of the method? In this case a test which showcases a child method not having a prototype should be added
A method has a prototype when it overrides a method in it's parent. It really wasn't clear, and is actually something I plan to add in a PR to the docs. The tests currently test a prototypeless method, but, are you suggesting it should cover a prototypeless method that in a child class too? |
I just saw looking at the linked issue, that this already kinda exists, I just think the naming is terrible but well better use the already existing name.
Yes, something like: class A {
}
class B extends A {
public function foo()
} And check what hasPrototype returns for |
I have added the test now @Girgias |
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.
The naming is terrible but it makes sense to stay consistent. The code LGTM.
This PR adds the
ReflectionMethod::hasPrototype
method, to allow users to check whether a method has a prototype, falling more in line with the way the other reflection methods are handled (getMethod
/hasMethod
, etc).Completes #8486