We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7984eca commit 1da768fCopy full SHA for 1da768f
src/PhpGenerator/PhpNamespace.php
@@ -180,9 +180,7 @@ public function __toString(): string
180
{
181
$uses = [];
182
foreach ($this->uses as $alias => $original) {
183
- $useNamespace = Helpers::extractNamespace($original);
184
-
185
- if ($this->name !== $useNamespace) {
+ if ($original !== ($this->name ? $this->name . '\\' . $alias : $alias)) {
186
if ($alias === $original || substr($original, -(strlen($alias) + 1)) === '\\' . $alias) {
187
$uses[] = "use $original;";
188
} else {
0 commit comments