1
0
mirror of https://github.com/danog/phpdoc.git synced 2024-11-30 04:29:12 +01:00

Improvements

This commit is contained in:
Daniil Gentili 2023-09-02 15:38:03 +02:00
parent 1ac05c37d8
commit 3e6bf3b50f
Signed by: danog
GPG Key ID: 8C1BE3B34B230CA7
2 changed files with 5 additions and 1 deletions

View File

@ -443,6 +443,10 @@ class PhpDoc
$this->useMap[$class][$alias] = $import; $this->useMap[$class][$alias] = $import;
$this->useMap[$class]['\\'.$alias] = $import; $this->useMap[$class]['\\'.$alias] = $import;
} }
if ($reflectionClass instanceof ReflectionClass) {
array_map($this->addTypeAliases(...), $reflectionClass->getTraitNames());
}
} }
/** /**
* Create directory recursively. * Create directory recursively.

View File

@ -162,7 +162,7 @@ class MethodDoc extends GenericDoc
*/ */
public function getSignatureAnchor(): string public function getSignatureAnchor(): string
{ {
$sig = $this->getSignature(); $sig = $this->name;
$sigLink = \strtolower($sig); $sigLink = \strtolower($sig);
$sigLink = \preg_replace('/[^\w ]+/', ' ', $sigLink); $sigLink = \preg_replace('/[^\w ]+/', ' ', $sigLink);
$sigLink = \preg_replace('/ +/', ' ', $sigLink); $sigLink = \preg_replace('/ +/', ' ', $sigLink);