diff --git a/src/PhpDoc.php b/src/PhpDoc.php index 684f503..bdf723d 100644 --- a/src/PhpDoc.php +++ b/src/PhpDoc.php @@ -443,6 +443,10 @@ class PhpDoc $this->useMap[$class][$alias] = $import; $this->useMap[$class]['\\'.$alias] = $import; } + + if ($reflectionClass instanceof ReflectionClass) { + array_map($this->addTypeAliases(...), $reflectionClass->getTraitNames()); + } } /** * Create directory recursively. diff --git a/src/PhpDoc/MethodDoc.php b/src/PhpDoc/MethodDoc.php index 922a768..54a35de 100644 --- a/src/PhpDoc/MethodDoc.php +++ b/src/PhpDoc/MethodDoc.php @@ -162,7 +162,7 @@ class MethodDoc extends GenericDoc */ public function getSignatureAnchor(): string { - $sig = $this->getSignature(); + $sig = $this->name; $sigLink = \strtolower($sig); $sigLink = \preg_replace('/[^\w ]+/', ' ', $sigLink); $sigLink = \preg_replace('/ +/', ' ', $sigLink);