| 1 | <?php |
||
| 8 | class ParsedComment |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * The comment itself. |
||
| 12 | * |
||
| 13 | * @var string |
||
| 14 | */ |
||
| 15 | protected $comment; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * The line where the comment starts. |
||
| 19 | * |
||
| 20 | * @var int |
||
| 21 | */ |
||
| 22 | protected $firstLine; |
||
| 23 | |||
| 24 | /** |
||
| 25 | * The line where the comment ends. |
||
| 26 | * |
||
| 27 | * @var int |
||
| 28 | */ |
||
| 29 | protected $lastLine; |
||
| 30 | |||
| 31 | /** |
||
| 32 | * Initializes the instance. |
||
| 33 | * |
||
| 34 | * @param string $comment The comment itself. |
||
| 35 | * @param int $firstLine The line where the comment starts. |
||
| 36 | * @param int $lastLine The line where the comment ends. |
||
| 37 | */ |
||
| 38 | public function __construct($comment, $firstLine, $lastLine) |
||
| 44 | |||
| 45 | /** |
||
| 46 | * Return the line where the comment starts. |
||
| 47 | * |
||
| 48 | * @return int Line number. |
||
| 49 | */ |
||
| 50 | public function getFirstLine() |
||
| 54 | |||
| 55 | /** |
||
| 56 | * Return the line where the comment ends. |
||
| 57 | * |
||
| 58 | * @return int Line number. |
||
| 59 | */ |
||
| 60 | public function getLastLine() |
||
| 64 | |||
| 65 | /** |
||
| 66 | * Return the actual comment string. |
||
| 67 | * |
||
| 68 | * @return string The comment. |
||
| 69 | */ |
||
| 70 | public function getComment() |
||
| 74 | |||
| 75 | /** |
||
| 76 | * Whether this comment is related with a given function. |
||
| 77 | * |
||
| 78 | * @param ParsedFunction $function The function to check. |
||
| 79 | * @return bool Whether the comment is related or not. |
||
| 80 | */ |
||
| 81 | public function isRelatedWith(ParsedFunction $function) |
||
| 85 | } |
||
| 86 |