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

Squiz.PHP.InnerFunctions.NotAllowed reported in anonymous classes #943

Closed
ondrejmirtes opened this issue Apr 4, 2016 · 2 comments
Closed

Comments

@ondrejmirtes
Copy link

I think this sniff rule is supposed to prevent old and discouraged PHP feature, but it also detects methods inside anonymous classes.

@gsherwood
Copy link
Member

Thanks for reporting this. It has been fixed.

@Th3Mouk
Copy link

Th3Mouk commented Nov 18, 2019

Hello !

The problem still occurs with

new class {
    public function valueObject(): object
    {
         return new class {
            public function string(): string {
                 return 'string';
            }
        };
    }
};

Th3Mouk added a commit to Th3Mouk/PHP_CodeSniffer that referenced this issue Nov 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants