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

readonly class: Expected 0 spaces before class keyword; 1 found #3947

Closed
2 of 3 tasks
steevanb opened this issue Apr 11, 2024 · 2 comments
Closed
2 of 3 tasks

readonly class: Expected 0 spaces before class keyword; 1 found #3947

steevanb opened this issue Apr 11, 2024 · 2 comments

Comments

@steevanb
Copy link

steevanb commented Apr 11, 2024

Describe the bug

When a class is readonly, ClassDeclaration sniff report Expected 0 spaces before class keyword; 1 found.

I know it's fixed on master (3f7b9ba), but i don't see any final version with this fix.

Could you please create 3.7.3?

Code sample

readonly class Foo
{
}

To reproduce

   9  [x] Expected 0 spaces before class keyword; 1 found
   |       |     (Squiz.Classes.ClassDeclaration.SpaceBeforeKeyword)

Expected behavior

No error ;)

Versions (please complete the following information)

Operating System [Windows 10 with WSL2 (tested on Debian and Ubutun 22.04)]
PHP version [8.3.4]
PHP_CodeSniffer version [3.7.2]
Standard [Squiz.Classes.ClassDeclaration.SpaceBeforeKeyword]
Install type [Composer global]

Please confirm:

  • I have searched the issue list and am not opening a duplicate issue.
  • I confirm that this bug is a bug in PHP_CodeSniffer and not in one of the external standards.
  • I have verified the issue still exists in the master branch of PHP_CodeSniffer.
@fredden
Copy link
Contributor

fredden commented Apr 11, 2024

@steevanb please have a look at #3932. If still relevant, please open a new issue in the new repository. The latest version of PHP_CodeSniffer is 3.9.1. From what I can tell, this change was released as part of 3.8.0.

@jrfnl
Copy link
Contributor

jrfnl commented Apr 11, 2024

@steevanb Please upgrade to the latest PHPCS version and your problem is gone. You are using version 3.7.2, while the latest PHPCS version is 3.9.1.

Closing as invalid.

@jrfnl jrfnl closed this as not planned Won't fix, can't repro, duplicate, stale Apr 11, 2024
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