mirror of
https://github.com/danog/phpdoc.git
synced 2024-11-26 12:04:47 +01:00
Add more features
This commit is contained in:
parent
6130ea30c5
commit
15526bf1eb
@ -172,6 +172,18 @@ class PhpDoc
|
||||
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Resolve type aliases.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function resolveAliases(): void
|
||||
{
|
||||
$classList = ClassFinder::getClassesInNamespace($this->namespace, $this->mode);
|
||||
foreach ($classList as $class) {
|
||||
$this->addTypeAliases($class);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Run documentor.
|
||||
*
|
||||
@ -179,10 +191,8 @@ class PhpDoc
|
||||
*/
|
||||
public function run(): self
|
||||
{
|
||||
$this->resolveAliases();
|
||||
$classList = ClassFinder::getClassesInNamespace($this->namespace, $this->mode);
|
||||
foreach ($classList as $class) {
|
||||
$this->addTypeAliases($class);
|
||||
}
|
||||
$namespaces = [];
|
||||
foreach ($this->useMap as $orig => $aliases) {
|
||||
$class = \str_replace('\\', '/', $orig);
|
||||
|
@ -135,10 +135,10 @@ class MethodDoc extends GenericDoc
|
||||
public function getSignatureAnchor(): string
|
||||
{
|
||||
$sig = $this->getSignature();
|
||||
$sigLink = strtolower($sig);
|
||||
$sigLink = preg_replace('/[^\w ]+/', ' ', $sigLink);
|
||||
$sigLink = preg_replace('/ +/', ' ', $sigLink);
|
||||
$sigLink = str_replace(' ', '-', $sigLink);
|
||||
$sigLink = \strtolower($sig);
|
||||
$sigLink = \preg_replace('/[^\w ]+/', ' ', $sigLink);
|
||||
$sigLink = \preg_replace('/ +/', ' ', $sigLink);
|
||||
$sigLink = \str_replace(' ', '-', $sigLink);
|
||||
return $sigLink;
|
||||
}
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user