-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Tokenizer detects wrong token for php ::class feature with spaces #2138
Comments
Thanks for reporting this, and you were 100% right on the fix. |
wmfgerrit
pushed a commit
to wikimedia/mediawiki-tools-codesniffer
that referenced
this issue
Aug 24, 2018
Test for using no space before and after -> or :: The sniff is an autofix sniff On testing I found problems with ":: class" in phpcs, see squizlabs/PHP_CodeSniffer#2138 but that used very low. Change-Id: I3b1c3b78fbe7650e06aaa0f6df00c937f575ca5d
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The following code:
the "class" in line 6 is token T_CLASS, while the "class" in line 9 is T_STRING. php lint is okay with a space there
This results in false positive on line 6 with the code ":: class" for some sniffs. The use of "::class" is okay in line 9.
It seems you have just to use $lastNotEmptyToken instead of -1 in PHP.php (search for classname::class)
The text was updated successfully, but these errors were encountered: