Skip to content

Commit 110e3b1

Browse files
authored
Merge pull request #52 from Crell/namespace-nest
Clarify wording around namespace grouping.
2 parents 77cea83 + d5841da commit 110e3b1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

spec.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@ namespace Vendor\Package;
213213
use Vendor\Package\{ClassA as A, ClassB, ClassC as C};
214214
use Vendor\Package\SomeNamespace\ClassD as D;
215215
use Vendor\Package\AnotherNamespace\ClassE as E;
216+
use SomeVendor\Pack\ANamespace\SubNamespace\ClassF;
216217

217218
use function Vendor\Package\{functionA, functionB, functionC};
218219
use function Another\Vendor\functionD;
@@ -229,8 +230,8 @@ class FooBar
229230
}
230231
```
231232

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

235236
```php
236237
<?php
@@ -249,6 +250,7 @@ And the following would not be allowed:
249250
<?php
250251

251252
use Vendor\Package\SomeNamespace\{
253+
// This has too many namespace segments to be in a group.
252254
SubnamespaceOne\AnotherNamespace\ClassA,
253255
SubnamespaceOne\ClassB,
254256
ClassZ,

0 commit comments

Comments
 (0)