From cee3c0bc21d102762a81432d23f4bff9d5ef8658 Mon Sep 17 00:00:00 2001 From: Mike van Riel Date: Sat, 30 Jun 2012 13:38:18 +0200 Subject: [PATCH] Namespace resolution did not work as intended The algorithm to expand a class name into a FCQN contained seevral errors. These are now gone and expansion should work as expected --- src/phpDocumentor/Reflection/DocBlock.php | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/src/phpDocumentor/Reflection/DocBlock.php b/src/phpDocumentor/Reflection/DocBlock.php index e09fdf1..ac5b6a4 100644 --- a/src/phpDocumentor/Reflection/DocBlock.php +++ b/src/phpDocumentor/Reflection/DocBlock.php @@ -350,21 +350,12 @@ class DocBlock implements \Reflector ) { $type_parts = explode('\\', $item); - // if the first part is the keyword 'namespace', replace it - // with the current namespace - if ($type_parts[0] == 'namespace') { - $type_parts[0] = $this->getNamespace(); - $item = implode('\\', $type_parts); - } - // if the first segment is an alias; replace with full name if (isset($this->namespace_aliases[$type_parts[0]])) { $type_parts[0] = $this->namespace_aliases[$type_parts[0]]; - $item = implode('\\', $type_parts); - } elseif (count($type_parts) == 1) { - // prefix the item with the namespace if there is only one - // part and no alias + } else { + // otherwise prepend the current namespace $item = $namespace . $item; } }