public __construct ( Reflector | string $docblock, phpDocumentor\Reflection\DocBlock\Context $context = null, phpDocumentor\Reflection\DocBlock\Location $location = null ) | ||
$docblock | Reflector | string | A docblock comment (including asterisks) or reflector supporting the getDocComment method. |
$context | phpDocumentor\Reflection\DocBlock\Context | The context in which the DocBlock occurs. |
$location | phpDocumentor\Reflection\DocBlock\Location | The location within the file that this DocBlock occurs in. |
public function __construct($docblock, Context $context = null, Location $location = null)
{
if (is_object($docblock)) {
if (!method_exists($docblock, 'getDocComment')) {
throw new \InvalidArgumentException('Invalid object passed; the given reflector must support ' . 'the getDocComment method');
}
$docblock = $docblock->getDocComment();
}
$docblock = $this->cleanInput($docblock);
list($short, $long, $tags) = $this->splitDocBlock($docblock);
$this->short_description = $short;
$this->long_description = new DocBlock\Description($long, $this);
$this->parseTags($tags);
$this->context = $context;
$this->location = $location;
}