這不是我的首選解決方案,但我設法快速補丁ApiGen來解決這個問題對我來說:
--- apigen/apigen/src/Templating/Filters/Helpers/ElementLinkFactory.php.orig Do Aug 13 14:51:13 2015
+++ apigen/apigen/src/Templating/Filters/Helpers/ElementLinkFactory.php Do Aug 13 14:51:33 2015
@@ -39,6 +39,7 @@ class ElementLinkFactory
$this->linkBuilder = $linkBuilder;
}
+ private $FULLY_QUALIFIED_NAMES=false;
/**
* @return string
@@ -75,7 +76,7 @@ class ElementLinkFactory
{
return $this->linkBuilder->build(
$this->elementUrlFactory->createForClass($reflectionClass),
- $reflectionClass->getName(),
+ $this->FULLY_QUALIFIED_NAMES ? $reflectionClass->getName() : $reflectionClass->getShortName(),
TRUE,
$classes
);
@@ -89,7 +90,7 @@ class ElementLinkFactory
{
return $this->linkBuilder->build(
$this->elementUrlFactory->createForMethod($reflectionMethod),
- $reflectionMethod->getDeclaringClassName() . '::' . $reflectionMethod->getName() . '()',
+ ($this->FULLY_QUALIFIED_NAMES ? $reflectionMethod->getDeclaringClass()->getName() : $reflectionMethod->getDeclaringClass()->getShortName()) . '::' . ($this->FULLY_QUALIFIED_NAMES ? $reflectionMethod->getName() : $reflectionMethod->getShortName()) . '()',
FALSE,
$classes
);
補丁使得它使用getShortName()
而不是getName()
上解決類。