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/anonymous class #630
Fix/anonymous class #630
Conversation
8dca727
to
0c8b6c1
Compare
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.
What do you think about adding a test for the case that this PR fixes?
From #616
namespace My\Namespace;
class Bug
{
public function createAnonymousClass()
{
new class
{
public function foo()
{
}
};
}
}
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.
It would be really nice to see the test case from the issue in subject.
No problem, i should have some time this weekend to work on it |
It holds functions so we should describe that
Overall this looks cleaner as well
72ea0ca
to
711b459
Compare
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.
👍
Thank you @BackEndTea |
Thank you @borNfreee & @sanmai |
Any chance to get this fix released? Thanks for all your hard work! |
This PR:
This is fixed in two ways:
First of all, it no longer uses reflection for the doc comments, since those are available from the parser. Secondly, to stop this from coming back in the future, it now keeps a stack of the current class, which does make mutators using the
REFLECTION_CLASS_KEY
responsible for checking if it is a valid value.The current uses in the public and protected mutators already do this.