class VersionTag in Zircon Profile 8.0
Same name and namespace in other branches
- 8 vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/VersionTag.php \phpDocumentor\Reflection\DocBlock\Tag\VersionTag
Reflection class for a @version 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
- class \phpDocumentor\Reflection\DocBlock\Tag implements \phpDocumentor\Reflection\DocBlock\Reflector
- class \phpDocumentor\Reflection\DocBlock\Tag\VersionTag
Expanded class hierarchy of VersionTag
2 files declare their use of VersionTag
- DeprecatedTag.php in vendor/
phpdocumentor/ reflection-docblock/ src/ phpDocumentor/ Reflection/ DocBlock/ Tag/ DeprecatedTag.php - SinceTag.php in vendor/
phpdocumentor/ reflection-docblock/ src/ phpDocumentor/ Reflection/ DocBlock/ Tag/ SinceTag.php
File
- vendor/
phpdocumentor/ reflection-docblock/ src/ phpDocumentor/ Reflection/ DocBlock/ Tag/ VersionTag.php, line 24
Namespace
phpDocumentor\Reflection\DocBlock\TagView source
class VersionTag extends Tag {
/**
* PCRE regular expression matching a version vector.
* Assumes the "x" modifier.
*/
const REGEX_VECTOR = '(?:
# Normal release vectors.
\\d\\S*
|
# VCS version vectors. Per PHPCS, they are expected to
# follow the form of the VCS name, followed by ":", followed
# by the version vector itself.
# By convention, popular VCSes like CVS, SVN and GIT use "$"
# around the actual version vector.
[^\\s\\:]+\\:\\s*\\$[^\\$]+\\$
)';
/** @var string The version vector. */
protected $version = '';
public function getContent() {
if (null === $this->content) {
$this->content = "{$this->version} {$this->description}";
}
return $this->content;
}
/**
* {@inheritdoc}
*/
public function setContent($content) {
parent::setContent($content);
if (preg_match('/^
# The version vector
(' . self::REGEX_VECTOR . ')
\\s*
# The description
(.+)?
$/sux', $this->description, $matches)) {
$this->version = $matches[1];
$this
->setDescription(isset($matches[2]) ? $matches[2] : '');
$this->content = $content;
}
return $this;
}
/**
* Gets the version section of the tag.
*
* @return string The version section of the tag.
*/
public function getVersion() {
return $this->version;
}
/**
* Sets the version section of the tag.
*
* @param string $version The new version section of the tag.
* An invalid value will set an empty string.
*
* @return $this
*/
public function setVersion($version) {
$this->version = preg_match('/^' . self::REGEX_VECTOR . '$/ux', $version) ? $version : '';
$this->content = null;
return $this;
}
}
Members
Name![]() |
Modifiers | Type | Description | Overrides |
---|---|---|---|---|
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 | |
VersionTag:: |
protected | property | @var string The version vector. | |
VersionTag:: |
public | function |
Gets the content of this tag. Overrides Tag:: |
|
VersionTag:: |
public | function | Gets the version section of the tag. | |
VersionTag:: |
constant | PCRE regular expression matching a version vector. Assumes the "x" modifier. | ||
VersionTag:: |
public | function |
Sets the content of this tag. Overrides Tag:: |
|
VersionTag:: |
public | function | Sets the version section of the tag. |