Skip to content
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

Merged
merged 7 commits into from Feb 17, 2019
Merged

Conversation

BackEndTea
Copy link
Member

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.

maks-rafalko
maks-rafalko previously approved these changes Feb 13, 2019
Copy link
Member

@maks-rafalko maks-rafalko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

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()
            {
            }
        };
    }
}

@maks-rafalko maks-rafalko added this to the 0.13.0 milestone Feb 13, 2019
Copy link
Member

@sanmai sanmai left a 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.

@BackEndTea
Copy link
Member Author

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

Copy link
Member

@maks-rafalko maks-rafalko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@maks-rafalko maks-rafalko merged commit ecde3d6 into infection:master Feb 17, 2019
@maks-rafalko
Copy link
Member

Thank you @BackEndTea

@BackEndTea
Copy link
Member Author

Thank you @borNfreee & @sanmai

@BackEndTea BackEndTea deleted the fix/anonymous-class branch February 17, 2019 09:04
@jakzal jakzal mentioned this pull request Feb 19, 2019
@jakzal
Copy link

jakzal commented Mar 23, 2019

Any chance to get this fix released? Thanks for all your hard work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error when parsing method that creates anonymous class
4 participants