File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -58,6 +58,9 @@ public function addNamespace(string $name): PhpNamespace
58
58
{
59
59
if (!isset ($ this ->namespaces [$ name ])) {
60
60
$ this ->namespaces [$ name ] = new PhpNamespace ($ name );
61
+ foreach ($ this ->namespaces as $ namespace ) {
62
+ $ namespace ->setBracketedSyntax (count ($ this ->namespaces ) > 1 && isset ($ this ->namespaces ['' ]));
63
+ }
61
64
}
62
65
return $ this ->namespaces [$ name ];
63
66
}
@@ -74,10 +77,6 @@ public function getNamespaces(): array
74
77
75
78
public function __toString (): string
76
79
{
77
- foreach ($ this ->namespaces as $ namespace ) {
78
- $ namespace ->setBracketedSyntax (count ($ this ->namespaces ) > 1 && isset ($ this ->namespaces ['' ]));
79
- }
80
-
81
80
return Strings::normalize (
82
81
"<?php \n"
83
82
. ($ this ->comment ? "\n" . Helpers::formatDocComment ($ this ->comment . "\n" ) . "\n" : '' )
You can’t perform that action at this time.
0 commit comments