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