diff --git a/library/Zend/Code/Reflection/DocBlockReflection.php b/library/Zend/Code/Reflection/DocBlockReflection.php index c43db8ddf9a..0b9a7fa3e4a 100644 --- a/library/Zend/Code/Reflection/DocBlockReflection.php +++ b/library/Zend/Code/Reflection/DocBlockReflection.php @@ -247,7 +247,7 @@ protected function reflect() return; } - $docComment = $this->docComment; // localize variable + $docComment = preg_replace('#[ ]{0,1}\*/$#', '', $this->docComment); // create a clean docComment $this->cleanDocComment = preg_replace("#[ \t]*(?:/\*\*|\*/|\*)[ ]{0,1}(.*)?#", '$1', $docComment); diff --git a/tests/ZendTest/Code/Reflection/DocBlockReflectionTest.php b/tests/ZendTest/Code/Reflection/DocBlockReflectionTest.php index 9c54cac94fc..fe088c233ed 100644 --- a/tests/ZendTest/Code/Reflection/DocBlockReflectionTest.php +++ b/tests/ZendTest/Code/Reflection/DocBlockReflectionTest.php @@ -59,6 +59,20 @@ public function testDocBlockTags() $this->assertEquals('mixed', $returnTag->getType()); } + public function testShortDocBlocks() + { + $classReflection = new ClassReflection('ZendTest\Code\Reflection\TestAsset\TestSampleClass13'); + $this->assertEquals(0, count($classReflection->getDocBlock()->getTags())); + + $this->assertSame('Short Method Description', $classReflection->getMethod('doSomething')->getDocBlock()->getShortDescription()); + $this->assertSame('Short Class Description', $classReflection->getDocBlock()->getShortDescription()); + + $returnTag = $classReflection->getMethod('returnSomething')->getDocBlock()->getTag('return'); + $this->assertInstanceOf('Zend\Code\Reflection\DocBlock\Tag\TagInterface', $returnTag); + $this->assertEquals('Something', $returnTag->getType()); + $this->assertEquals('This describes something', $returnTag->getDescription()); + } + public function testTabbedDocBlockTags() { $classReflection = new ClassReflection('ZendTest\Code\Reflection\TestAsset\TestSampleClass10'); @@ -85,8 +99,6 @@ public function testTabbedDocBlockTags() public function testDocBlockLines() { - //$this->markTestIncomplete('Line numbers incomplete'); - $classReflection = new ClassReflection('ZendTest\Code\Reflection\TestAsset\TestSampleClass5'); $classDocBlock = $classReflection->getDocBlock(); diff --git a/tests/ZendTest/Code/Reflection/TestAsset/TestSampleClass13.php b/tests/ZendTest/Code/Reflection/TestAsset/TestSampleClass13.php new file mode 100644 index 00000000000..c3b1e47e5f2 --- /dev/null +++ b/tests/ZendTest/Code/Reflection/TestAsset/TestSampleClass13.php @@ -0,0 +1,15 @@ +