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

PSR12/AnonClassDeclaration: prevent fixer creating parse error #3791

Conversation

jrfnl
Copy link
Contributor

@jrfnl jrfnl commented Apr 2, 2023

This fix prevents the fixer from removing the opening brace when there is no whitespace between the last character of the name of an interface and the open brace.

With this fix in place, all other symptoms reported are also gone as they were a side-effect of the parse error being created.

Includes unit test.

Fixes #3790

This fix prevents the fixer from removing the opening brace when there is no whitespace between the last character of the name of an interface and the open brace.

With this fix in place, all other symptoms reported are also gone as they were a side-effect of the parse error being created.

Includes unit test.

Fixes 3790
@jrfnl
Copy link
Contributor Author

jrfnl commented Dec 2, 2023

Closing as replaced by PHPCSStandards/PHP_CodeSniffer#56

@jrfnl jrfnl closed this Dec 2, 2023
@jrfnl jrfnl deleted the feature/3790-psr12-anonclassdeclaration-prevent-parse-error branch December 2, 2023 02:17
@jrfnl
Copy link
Contributor Author

jrfnl commented Dec 8, 2023

FYI: this fix is included in today's PHP_CodeSniffer 3.8.0 release.

As per #3932, development on PHP_CodeSniffer will continue in the PHPCSStandards/PHP_CodeSniffer repository. If you want to stay informed, you may want to start "watching" that repo (or watching releases from that repo).

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

Successfully merging this pull request may close these issues.

Anonymous classes with interfaces missing space before opening bracket cause parse error with PSR-12 ruleset
2 participants