You are here

class LinkTag in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/LinkTag.php \phpDocumentor\Reflection\DocBlock\Tag\LinkTag

Reflection class for a @link tag in a Docblock.

@author Ben Selby <benmatselby@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\LinkTag

Expanded class hierarchy of LinkTag

File

vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/LinkTag.php, line 24

Namespace

phpDocumentor\Reflection\DocBlock\Tag
View source
class LinkTag extends Tag {

  /** @var string */
  protected $link = '';

  /**
   * {@inheritdoc}
   */
  public function getContent() {
    if (null === $this->content) {
      $this->content = "{$this->link} {$this->description}";
    }
    return $this->content;
  }

  /**
   * {@inheritdoc}
   */
  public function setContent($content) {
    parent::setContent($content);
    $parts = preg_split('/\\s+/Su', $this->description, 2);
    $this->link = $parts[0];
    $this
      ->setDescription(isset($parts[1]) ? $parts[1] : $parts[0]);
    $this->content = $content;
    return $this;
  }

  /**
   * Gets the link
   *
   * @return string
   */
  public function getLink() {
    return $this->link;
  }

  /**
   * Sets the link
   *
   * @param string $link The link
   *
   * @return $this
   */
  public function setLink($link) {
    $this->link = $link;
    $this->content = null;
    return $this;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
LinkTag::$link protected property @var string
LinkTag::getContent public function Gets the content of this tag. Overrides Tag::getContent
LinkTag::getLink public function Gets the link
LinkTag::setContent public function Sets the content of this tag. Overrides Tag::setContent
LinkTag::setLink public function Sets the link
Tag::$content protected property When set to NULL, it means it needs to be regenerated.
Tag::$description protected property @var string Description of the content of this tag
Tag::$docblock protected property @var DocBlock The DocBlock which this tag belongs to.
Tag::$location protected property @var Location Location of the tag.
Tag::$parsedDescription protected property When set to NULL, it means it needs to be regenerated.
Tag::$tag protected property @var string Name of the tag
Tag::$tagHandlerMappings private static property handles it as an array value. The class is expected to inherit this class.
Tag::createInstance final public static function Factory method responsible for instantiating the correct sub type.
Tag::export public static function Builds a string representation of this object.
Tag::getDescription public function Gets the description component of this tag.
Tag::getDocBlock public function Gets the docblock this tag belongs to.
Tag::getLocation public function Gets the location of the tag.
Tag::getName public function Gets the name of this tag.
Tag::getParsedDescription public function Gets the parsed text of this description.
Tag::REGEX_TAGNAME constant PCRE regular expression matching a tag name.
Tag::registerTagHandler final public static function Registers a handler for tags.
Tag::setDescription public function Sets the description component of this tag.
Tag::setDocBlock public function Sets the docblock this tag belongs to.
Tag::setLocation public function Sets the location of the tag.
Tag::setName public function Sets the name of this tag.
Tag::__construct public function Parses a tag and populates the member variables.
Tag::__toString public function Returns the tag as a serialized string