Permalink
Browse files

Better (more PHP-like) resolving of elements

  • Loading branch information...
1 parent badfc21 commit 7416b48ebd140900611a5157f4bf3b1523c2f6cc @Andrewsville Andrewsville committed with kukulich Mar 26, 2012
Showing with 4 additions and 3 deletions.
  1. +4 −3 ApiGen/Generator.php
View
@@ -1461,9 +1461,10 @@ public function resolveElement($definition, ReflectionElement $context)
$context = $this->getClass($context->getDeclaringClassName());
}
- if (($class = $this->getClass(\TokenReflection\Resolver::resolveClassFQN($definition, $context->getNamespaceAliases(), $context->getNamespaceName()), $context->getNamespaceName()))
- || ($class = $this->getClass($definition, $context->getNamespaceName()))
- ) {
+ if ($definition !== ($className = \TokenReflection\Resolver::resolveClassFQN($definition, $context->getNamespaceAliases(), $context->getNamespaceName()))) {
+ // Aliased class
+ return $this->getClass($className, $context->getNamespaceName());
+ } elseif ($class = $this->getClass($definition, $context->getNamespaceName())) {
// Class
return $class;
} elseif ($constant = $this->getConstant($definition, $context->getNamespaceName())) {

0 comments on commit 7416b48

Please sign in to comment.