-
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
Squiz.WhiteSpace.ScopeKeywordSpacing false positive for static return type #3188
Comments
Thanks for reporting this. I can not reproduce the first error. The second one (line 43) I can reproduce with your code sample. PR #3189 should fix this. Testing appreciated. |
Thanks for this so fast response! Indeed, the error line 35 was actually caused by public static function myMethod(): static|\Closure Do you think your fix will cover it too? EDIT: saw the code you've made for union, so it'll work! |
@jrfnl I can confirm it's ok, both problems solved! Thanks for being so efficient! |
Thanks for testing @mathieutu! Glad to see the confirmation that this will now be fixed once the PR is merged. |
Describe the bug
Php8 allows static as a valid return type. I've seen the PHPCS PR which allows that.
However I still have an issue with the
Squiz.WhiteSpace.ScopeKeywordSpacing.Incorrect
rule.Code sample
Error
Expected behavior
Phpcs should not emit an error for a space after static.
And actually
static
as a return type should be considerated by phpcs as a Scope Keyword.Versions:
The text was updated successfully, but these errors were encountered: