You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First, what is a "scoped namespace?" I cannot find this verbiage in the PHP docs.
Namespace declarations with curly brackets - in PHPCS - create scope conditions for the code contained between them. That's what the term is about.
As for multiple namespaces in the same file, I am going to argue against adding a filter for it. Let me explain:
Sorry, but your arguments are irrelevant to this issue.
This issue is not about whether you should use the sniff, only about whether there is interest in such a sniff.
The sniff would go into Generic and would not be added to any of the PHPCS native standards, so by default, it wouldn't be used, unless you specificallychooseto turn it on.
In other words, once it would be added to PHPCS, it would be possible for people to choose to add it to their standard, but if you don't like, it's simple: just don't add it.
I'm going to close this issue. While these sniffs ended up not being pulled to PHPCS itself, they did get written and are now publicly available via the PHPCSExtra package (Packagist/Composer: phpcsstandards/phpcsextra).
Is there interest in a namespace declaration sniff which would check for things like:
namespace;
, and forbid their use.I wrote a sniff for this for an in-company standard already and if there is interest, they're happy to let me pull it here.
The text was updated successfully, but these errors were encountered: