/** * Extracts the @package information from the given comment. * * @param string $comment A doc comment block. * * @return string */ private function _parsePackageAnnotation($comment) { $package = self::DEFAULT_PACKAGE; if (preg_match('#\\*\\s*@package\\s+(\\S+)#', $comment, $match)) { $package = trim($match[1]); if (preg_match('#\\*\\s*@subpackage\\s+(\\S+)#', $comment, $match)) { $package .= self::PACKAGE_SEPARATOR . trim($match[1]); } } // Check for doc level comment if ($this->_globalPackageName === self::DEFAULT_PACKAGE && $this->isFileComment() === true) { $this->_globalPackageName = $package; $this->_sourceFile->setDocComment($comment); } return $package; }
/** * testGetDocCommentReturnsInjectedDocCommentValue * * @return void * @group pdepend * @group pdepend::code * @group unittest */ public function testGetDocCommentReturnsInjectedDocCommentValue() { $file = new PHP_Depend_Code_File(null); $file->setDocComment('/** Manuel */'); self::assertEquals('/** Manuel */', $file->getDocComment()); }