Skip to content

Commit 94d4cba

Browse files
authored
Prevent aliasing self class in use statements (#1830)
1 parent 6f192a8 commit 94d4cba

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Generator/PhpGenerator/ClassBuilder.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ public function getClassName(): ClassName
5050

5151
public function addUse(string $name): self
5252
{
53+
if ($name === $this->className->getFqdn()) {
54+
return $this;
55+
}
56+
5357
$this->namespace->addUse($name);
5458

5559
return $this;

0 commit comments

Comments
 (0)