Skip to content

Clarify wording around namespace grouping. #52

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

Merged
merged 1 commit into from
Nov 10, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ namespace Vendor\Package;
use Vendor\Package\{ClassA as A, ClassB, ClassC as C};
use Vendor\Package\SomeNamespace\ClassD as D;
use Vendor\Package\AnotherNamespace\ClassE as E;
use SomeVendor\Pack\ANamespace\SubNamespace\ClassF;

use function Vendor\Package\{functionA, functionB, functionC};
use function Another\Vendor\functionD;
Expand All @@ -229,8 +230,8 @@ class FooBar
}
```

Compound namespaces with a depth of more than two MUST NOT be used. Therefore, the
following is the maximum compounding depth allowed:
When using compound namespaces, there MUST NOT be more than two sub-namespaces within the group.
That is, the following is allowed:

```php
<?php
Expand All @@ -249,6 +250,7 @@ And the following would not be allowed:
<?php

use Vendor\Package\SomeNamespace\{
// This has too many namespace segments to be in a group.
SubnamespaceOne\AnotherNamespace\ClassA,
SubnamespaceOne\ClassB,
ClassZ,
Expand Down