class SourceTag in Zircon Profile 8.0
Same name and namespace in other branches
- 8 vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/SourceTag.php \phpDocumentor\Reflection\DocBlock\Tag\SourceTag
Reflection class for a @source tag in a Docblock.
@author Vasil Rangelov <boen.robot@gmail.com> @license http://www.opensource.org/licenses/mit-license.php MIT @link http://phpdoc.org
Hierarchy
Expanded class hierarchy of SourceTag
File
- vendor/
phpdocumentor/ reflection-docblock/ src/ phpDocumentor/ Reflection/ DocBlock/ Tag/ SourceTag.php, line 24
Namespace
phpDocumentor\Reflection\DocBlock\TagView source
class SourceTag extends Tag {
/**
* @var int The starting line, relative to the structural element's
* location.
*/
protected $startingLine = 1;
/**
* @var int|null The number of lines, relative to the starting line. NULL
* means "to the end".
*/
protected $lineCount = null;
/**
* {@inheritdoc}
*/
public function getContent() {
if (null === $this->content) {
$this->content = "{$this->startingLine} {$this->lineCount} {$this->description}";
}
return $this->content;
}
/**
* {@inheritdoc}
*/
public function setContent($content) {
parent::setContent($content);
if (preg_match('/^
# Starting line
([1-9]\\d*)
\\s*
# Number of lines
(?:
((?1))
\\s+
)?
# Description
(.*)
$/sux', $this->description, $matches)) {
$this->startingLine = (int) $matches[1];
if (isset($matches[2]) && '' !== $matches[2]) {
$this->lineCount = (int) $matches[2];
}
$this
->setDescription($matches[3]);
$this->content = $content;
}
return $this;
}
/**
* Gets the starting line.
*
* @return int The starting line, relative to the structural element's
* location.
*/
public function getStartingLine() {
return $this->startingLine;
}
/**
* Sets the starting line.
*
* @param int $startingLine The new starting line, relative to the
* structural element's location.
*
* @return $this
*/
public function setStartingLine($startingLine) {
$this->startingLine = $startingLine;
$this->content = null;
return $this;
}
/**
* Returns the number of lines.
*
* @return int|null The number of lines, relative to the starting line. NULL
* means "to the end".
*/
public function getLineCount() {
return $this->lineCount;
}
/**
* Sets the number of lines.
*
* @param int|null $lineCount The new number of lines, relative to the
* starting line. NULL means "to the end".
*
* @return $this
*/
public function setLineCount($lineCount) {
$this->lineCount = $lineCount;
$this->content = null;
return $this;
}
}
Members
Name![]() |
Modifiers | Type | Description | Overrides |
---|---|---|---|---|
SourceTag:: |
protected | property | means "to the end". | |
SourceTag:: |
protected | property | location. | |
SourceTag:: |
public | function |
Gets the content of this tag. Overrides Tag:: |
1 |
SourceTag:: |
public | function | Returns the number of lines. | |
SourceTag:: |
public | function | Gets the starting line. | |
SourceTag:: |
public | function |
Sets the content of this tag. Overrides Tag:: |
1 |
SourceTag:: |
public | function | Sets the number of lines. | |
SourceTag:: |
public | function | Sets the starting line. | |
Tag:: |
protected | property | When set to NULL, it means it needs to be regenerated. | |
Tag:: |
protected | property | @var string Description of the content of this tag | |
Tag:: |
protected | property | @var DocBlock The DocBlock which this tag belongs to. | |
Tag:: |
protected | property | @var Location Location of the tag. | |
Tag:: |
protected | property | When set to NULL, it means it needs to be regenerated. | |
Tag:: |
protected | property | @var string Name of the tag | |
Tag:: |
private static | property | handles it as an array value. The class is expected to inherit this class. | |
Tag:: |
final public static | function | Factory method responsible for instantiating the correct sub type. | |
Tag:: |
public static | function | Builds a string representation of this object. | |
Tag:: |
public | function | Gets the description component of this tag. | |
Tag:: |
public | function | Gets the docblock this tag belongs to. | |
Tag:: |
public | function | Gets the location of the tag. | |
Tag:: |
public | function | Gets the name of this tag. | |
Tag:: |
public | function | Gets the parsed text of this description. | |
Tag:: |
constant | PCRE regular expression matching a tag name. | ||
Tag:: |
final public static | function | Registers a handler for tags. | |
Tag:: |
public | function | Sets the description component of this tag. | |
Tag:: |
public | function | Sets the docblock this tag belongs to. | |
Tag:: |
public | function | Sets the location of the tag. | |
Tag:: |
public | function | Sets the name of this tag. | |
Tag:: |
public | function | Parses a tag and populates the member variables. | |
Tag:: |
public | function | Returns the tag as a serialized string |