这不是我的首选解决方案,但我设法快速补丁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()
上解决类。