Index: library/Zend/Reflection/Docblock/Tag/Return.php =================================================================== --- library/Zend/Reflection/Docblock/Tag/Return.php (revision 19009) +++ library/Zend/Reflection/Docblock/Tag/Return.php (working copy) @@ -43,7 +43,7 @@ */ public function __construct($tagDocblockLine) { - if (!preg_match('#^@(\w+)\s+(\w+)(?:\s+(.*))?#', $tagDocblockLine, $matches)) { + if (!preg_match('#^@(\w+)\s+([\w|\\\]+)(?:\s+(.*))?#', $tagDocblockLine, $matches)) { require_once 'Zend/Reflection/Exception.php'; throw new Zend_Reflection_Exception('Provided docblock line is does not contain a valid tag'); } Index: library/Zend/Reflection/Docblock/Tag/Param.php =================================================================== --- library/Zend/Reflection/Docblock/Tag/Param.php (revision 19009) +++ library/Zend/Reflection/Docblock/Tag/Param.php (working copy) @@ -49,7 +49,7 @@ { $matches = array(); - if (!preg_match('#^@(\w+)\s+(\w+)(?:\s+(\$\S+))?(?:\s+(.*))?#s', $tagDocblockLine, $matches)) { + if (!preg_match('#^@(\w+)\s+([\w|\\\]+)(?:\s+(\$\S+))?(?:\s+(.*))?#s', $tagDocblockLine, $matches)) { require_once 'Zend/Reflection/Exception.php'; throw new Zend_Reflection_Exception('Provided docblock line is does not contain a valid tag'); } Index: tests/Zend/Reflection/Docblock/Tag/ReturnTest.php =================================================================== --- tests/Zend/Reflection/Docblock/Tag/ReturnTest.php (revision 19009) +++ tests/Zend/Reflection/Docblock/Tag/ReturnTest.php (working copy) @@ -64,5 +64,27 @@ $this->assertEquals($paramTag->getType(), 'string', 'Second Match Failed'); $this->assertEquals($paramTag->getDescription(),'Description of return value', 'Final Match Failed'); } + + /** + * @group ZF-8307 + */ + public function testReturnClassWithNamespace() + { + $classReflection = new Zend_Reflection_Class('Zend_Reflection_Docblock_Param_ReturnNamespace'); + + $paramTag = $classReflection->getMethod('doSomething')->getDocblock()->getTag('return'); + + $this->assertEquals('Zend\Reflection\Docblock', $paramTag->getType()); + } } +class Zend_Reflection_Docblock_Param_ReturnNamespace +{ + /** + * @return Zend\Reflection\Docblock + */ + public function doSomething() + { + + } +} Index: tests/Zend/Reflection/Docblock/Tag/ParamTest.php =================================================================== --- tests/Zend/Reflection/Docblock/Tag/ParamTest.php (revision 19009) +++ tests/Zend/Reflection/Docblock/Tag/ParamTest.php (working copy) @@ -74,5 +74,27 @@ $this->assertEquals($paramTag->getVariableName(), '$var', 'Third Match Failed'); $this->assertEquals($paramTag->getDescription(),'Description of $var', 'Final Match Failed'); } + + /** + * @group ZF-8307 + */ + public function testNamespaceInParam() + { + $classReflection = new Zend_Reflection_Class('Zend_Reflection_Docblock_Tag_ParamNamespace'); + $paramTag = $classReflection->getMethod('example')->getDocblock()->getTag('param'); + + $this->assertEquals('Zend\Foo\Bar', $paramTag->getType()); + $this->assertEquals('$var', $paramTag->getVariableName()); + $this->assertEquals('desc', $paramTag->getDescription()); + } } +class Zend_Reflection_Docblock_Tag_ParamNamespace +{ + /** + * @param Zend\Foo\Bar $var desc + */ + public function example() + { } +} +