class AuthorTag in Zircon Profile 8.0
Same name and namespace in other branches
- 8 vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/AuthorTag.php \phpDocumentor\Reflection\DocBlock\Tag\AuthorTag
Reflection class for an @author tag in a Docblock.
@author Mike van Riel <mike.vanriel@naenius.com> @license http://www.opensource.org/licenses/mit-license.php MIT @link http://phpdoc.org
Hierarchy
Expanded class hierarchy of AuthorTag
File
- vendor/
phpdocumentor/ reflection-docblock/ src/ phpDocumentor/ Reflection/ DocBlock/ Tag/ AuthorTag.php, line 24
Namespace
phpDocumentor\Reflection\DocBlock\TagView source
class AuthorTag extends Tag {
/**
* PCRE regular expression matching any valid value for the name component.
*/
const REGEX_AUTHOR_NAME = '[^\\<]*';
/**
* PCRE regular expression matching any valid value for the email component.
*/
const REGEX_AUTHOR_EMAIL = '[^\\>]*';
/** @var string The name of the author */
protected $authorName = '';
/** @var string The email of the author */
protected $authorEmail = '';
public function getContent() {
if (null === $this->content) {
$this->content = $this->authorName;
if ('' != $this->authorEmail) {
$this->content .= "<{$this->authorEmail}>";
}
}
return $this->content;
}
/**
* {@inheritdoc}
*/
public function setContent($content) {
parent::setContent($content);
if (preg_match('/^(' . self::REGEX_AUTHOR_NAME . ')(\\<(' . self::REGEX_AUTHOR_EMAIL . ')\\>)?$/u', $this->description, $matches)) {
$this->authorName = trim($matches[1]);
if (isset($matches[3])) {
$this->authorEmail = trim($matches[3]);
}
}
return $this;
}
/**
* Gets the author's name.
*
* @return string The author's name.
*/
public function getAuthorName() {
return $this->authorName;
}
/**
* Sets the author's name.
*
* @param string $authorName The new author name.
* An invalid value will set an empty string.
*
* @return $this
*/
public function setAuthorName($authorName) {
$this->content = null;
$this->authorName = preg_match('/^' . self::REGEX_AUTHOR_NAME . '$/u', $authorName) ? $authorName : '';
return $this;
}
/**
* Gets the author's email.
*
* @return string The author's email.
*/
public function getAuthorEmail() {
return $this->authorEmail;
}
/**
* Sets the author's email.
*
* @param string $authorEmail The new author email.
* An invalid value will set an empty string.
*
* @return $this
*/
public function setAuthorEmail($authorEmail) {
$this->authorEmail = preg_match('/^' . self::REGEX_AUTHOR_EMAIL . '$/u', $authorEmail) ? $authorEmail : '';
$this->content = null;
return $this;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
AuthorTag:: |
protected | property | @var string The email of the author | |
AuthorTag:: |
protected | property | @var string The name of the author | |
AuthorTag:: |
public | function | Gets the author's email. | |
AuthorTag:: |
public | function | Gets the author's name. | |
AuthorTag:: |
public | function |
Gets the content of this tag. Overrides Tag:: |
|
AuthorTag:: |
constant | PCRE regular expression matching any valid value for the email component. | ||
AuthorTag:: |
constant | PCRE regular expression matching any valid value for the name component. | ||
AuthorTag:: |
public | function | Sets the author's email. | |
AuthorTag:: |
public | function | Sets the author's name. | |
AuthorTag:: |
public | function |
Sets the content of this tag. Overrides Tag:: |
|
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 |