/** * @param \ReflectionClass|\ReflectionMethod|\ReflectionFunction|\ReflectionProperty $reflector * @param string $target * * @return Comment */ protected function process($reflector, $target) { if (method_exists($reflector, 'getDeclaringClass')) { $classReflector = $reflector->getDeclaringClass(); } else { $classReflector = $reflector; } $filename = $classReflector->getFileName(); $this->parser->setImports($this->getImports($filename, $classReflector->getStartLine())); $this->parser->setNamespaces($this->defaultNamespace, $this->namespaces[$filename]); return $this->parser->parse($reflector->getDocComment(), $target); }
/** * @expectedException \InvalidArgumentException */ public function testStringsNeedToBeTerminated() { $this->object->parse('/** @something(invalid") */', 'class'); }