-
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
Generic.Whitespace.LanguageConstructSpacing should not be checking namespace operators #2194
Comments
It's a bug |
Ok, will fix it. |
@gsherwood Just checking - should just the bug be fixed, i.e. no error should be thrown, or should the sniff be enhanced to demand no space between the namespace keyword as an operator and the |
I think it should just ignore the namespace keyword when used like that. Rules for how namespaces are defined (spaces or not, newlines or not, etc) should probably be left to other sniffs. |
Okidoki. Though IIRC there is no sniff which currently covers the namespace keyword as an operator. I think I'll address this when I finally get round to fixing #2150. |
The
Generic.Whitespace.LanguageConstructSpacing
sniff demands one space after PHP language construct keywords.The
namespace
keyword however, is both a construct as well as an operator, depending on the context.See: http://php.net/manual/en/language.namespaces.nsconstants.php#example-256
Currently, the sniff will trigger errors for the use of the keyword as an operator and demand one space after the keyword.
This, to me, is unexpected.
Is this intended behaviour or a bug ? /cc @gmponos
The text was updated successfully, but these errors were encountered: