diff --git a/src/Scanner/MethodScanner.php b/src/Scanner/MethodScanner.php index bea52ecd..2f787474 100644 --- a/src/Scanner/MethodScanner.php +++ b/src/Scanner/MethodScanner.php @@ -522,6 +522,13 @@ protected function scan() goto SCANNER_CONTINUE_SIGNATURE; // goto (no break needed); + case T_NS_SEPARATOR: + if (!isset($infos[$infoIndex])) { + $MACRO_INFO_START(); + } + goto SCANNER_CONTINUE_SIGNATURE; + // goto (no break needed); + case T_VARIABLE: case T_STRING: if ($tokenType === T_STRING && $parentCount === 0) { diff --git a/test/Scanner/ClassScannerTest.php b/test/Scanner/ClassScannerTest.php index 449a71eb..e350db24 100644 --- a/test/Scanner/ClassScannerTest.php +++ b/test/Scanner/ClassScannerTest.php @@ -160,7 +160,7 @@ public function testClassScannerCanReturnLineNumbers() $file = new FileScanner(__DIR__ . '/../TestAsset/BarClass.php'); $class = $file->getClass('ZendTest\Code\TestAsset\BarClass'); $this->assertEquals(10, $class->getLineStart()); - $this->assertEquals(37, $class->getLineEnd()); + $this->assertEquals(42, $class->getLineEnd()); } public function testClassScannerCanScanAnnotations() diff --git a/test/Scanner/MethodScannerTest.php b/test/Scanner/MethodScannerTest.php index ddabcc81..e4c60e31 100644 --- a/test/Scanner/MethodScannerTest.php +++ b/test/Scanner/MethodScannerTest.php @@ -48,6 +48,16 @@ public function testMethodScannerReturnsParameterScanner() $this->assertEquals('t', $parameter->getName()); } + public function testMethodScannerParsesClassNames() + { + $file = new FileScanner(__DIR__ . '/../TestAsset/BarClass.php'); + $class = $file->getClass('ZendTest\Code\TestAsset\BarClass'); + $method = $class->getMethod('five'); + $this->assertEquals(['a'], $method->getParameters()); + $parameter = $method->getParameter('a'); + $this->assertEquals('ZendTest\Code\TestAsset\AbstractClass', $parameter->getClass()); + } + public function testMethodScannerReturnsPropertyWithNoDefault() { $file = new FileScanner(__DIR__ . '/../TestAsset/BazClass.php'); diff --git a/test/TestAsset/BarClass.php b/test/TestAsset/BarClass.php index 5adf91cc..aa977dfb 100644 --- a/test/TestAsset/BarClass.php +++ b/test/TestAsset/BarClass.php @@ -34,4 +34,9 @@ protected function four($one, $two = array(array(array('default')))) { // four } + + private function five(\ZendTest\Code\TestAsset\AbstractClass $a) + { + // five + } }