7 * @author Vasil Rangelov <boen.robot@gmail.com>
8 * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com)
9 * @license http://www.opensource.org/licenses/mit-license.php MIT
10 * @link http://phpdoc.org
13 namespace phpDocumentor\Reflection\DocBlock\Tag;
15 use phpDocumentor\Reflection\DocBlock\Tag;
18 * Reflection class for a @source tag in a Docblock.
20 * @author Vasil Rangelov <boen.robot@gmail.com>
21 * @license http://www.opensource.org/licenses/mit-license.php MIT
22 * @link http://phpdoc.org
24 class SourceTag extends Tag
27 * @var int The starting line, relative to the structural element's
30 protected $startingLine = 1;
33 * @var int|null The number of lines, relative to the starting line. NULL
36 protected $lineCount = null;
41 public function getContent()
43 if (null === $this->content) {
45 = "{$this->startingLine} {$this->lineCount} {$this->description}";
48 return $this->content;
54 public function setContent($content)
56 parent::setContent($content);
73 $this->startingLine = (int)$matches[1];
74 if (isset($matches[2]) && '' !== $matches[2]) {
75 $this->lineCount = (int)$matches[2];
77 $this->setDescription($matches[3]);
78 $this->content = $content;
85 * Gets the starting line.
87 * @return int The starting line, relative to the structural element's
90 public function getStartingLine()
92 return $this->startingLine;
96 * Sets the starting line.
98 * @param int $startingLine The new starting line, relative to the
99 * structural element's location.
103 public function setStartingLine($startingLine)
105 $this->startingLine = $startingLine;
107 $this->content = null;
112 * Returns the number of lines.
114 * @return int|null The number of lines, relative to the starting line. NULL
115 * means "to the end".
117 public function getLineCount()
119 return $this->lineCount;
123 * Sets the number of lines.
125 * @param int|null $lineCount The new number of lines, relative to the
126 * starting line. NULL means "to the end".
130 public function setLineCount($lineCount)
132 $this->lineCount = $lineCount;
134 $this->content = null;