Skip to content

Namespace limitation confusion in PSR-12 #51

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

Closed
JordanRL opened this issue Oct 28, 2022 · 1 comment · Fixed by #52
Closed

Namespace limitation confusion in PSR-12 #51

JordanRL opened this issue Oct 28, 2022 · 1 comment · Fixed by #52
Labels
enhancement New feature or request

Comments

@JordanRL
Copy link

Leaving this on @Crell's request:

The PSR-12 documentation has this section: https://www.php-fig.org/psr/psr-12/#3-declare-statements-namespace-and-import-statements

Compound namespaces with a depth of more than two MUST NOT be used. Therefore the following is the maximum compounding depth allowed:

While it should be clear that this restriction of two namespaces is specific to the use of grouping, I was confused for a bit whether it was meant to limit all namespaces to a depth of 4 total, 2 beyond the package namespace. This was because "compounding" is not what I've ever heard that called (always heard it called grouping instead), and because all the examples in that section, even those that do not have grouping, are limited to a total depth of 4, except the example of what is not allowed.

@samdark
Copy link
Member

samdark commented Nov 6, 2022

Yes. That's a good thing to re-word.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants