-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Fix static callable. #2054
Fix static callable. #2054
Conversation
Can you add some tests to avoid any regressions? |
c8124f7
to
fa2ae48
Compare
I've added the tests that walk through all possible paths of the changed code. |
if ($r instanceof ReflectionMethod) { | ||
$callableName = $r->class.'::'.$r->name; | ||
} else { | ||
$callableName = $r->name; |
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.
This should be moved back where it was before. This was done on purpose so that the $callableName
is always defined (for HHVM/Hack).
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.
not sure if I follow, $callableName
will always be defined here. Is there something special with HHVM/Hack related to the previous $r->getDeclaringClass()
or something?
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.
@fabpot it is always defined in the new logic
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.
In any case, there is no need to change this part of the code.
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.
yes there is, if $r
is not a ReflectionMethod
calling getDeclaringClass
on it will result in the error reported
(tests to prove this have been added)
b57a7f9
to
8f6fd57
Compare
ping @fabpot I think this one ready, please let me know if you anything changed :) |
Thank you @SpacePossum. |
fixes #2053