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 | * Create new object from raw comment data. |
||
47 | * |
||
48 | * @param string $value The PHP comment string. |
||
49 | * @param int $line The line where the comment starts. |
||
50 | * |
||
51 | * @return self The parsed comment. |
||
52 | */ |
||
53 | public static function create($value, $line) |
||
74 | |||
75 | /** |
||
76 | * Return the line where the comment starts. |
||
77 | * |
||
78 | * @return int Line number. |
||
79 | */ |
||
80 | public function getFirstLine() |
||
84 | |||
85 | /** |
||
86 | * Return the line where the comment ends. |
||
87 | * |
||
88 | * @return int Line number. |
||
89 | */ |
||
90 | public function getLastLine() |
||
94 | |||
95 | /** |
||
96 | * Return the actual comment string. |
||
97 | * |
||
98 | * @return string The comment. |
||
99 | */ |
||
100 | public function getComment() |
||
104 | |||
105 | /** |
||
106 | * Whether this comment is related with a given function. |
||
107 | * |
||
108 | * @param ParsedFunction $function The function to check. |
||
109 | * @return bool Whether the comment is related or not. |
||
110 | */ |
||
111 | public function isRelatedWith(ParsedFunction $function) |
||
115 | |||
116 | /** |
||
117 | * Whether the comment matches the required prefixes. |
||
118 | * |
||
119 | * @param array $prefixes An array of prefixes to check. |
||
120 | * @return bool Whether the comment matches the prefixes or not. |
||
121 | */ |
||
122 | public function checkPrefixes($prefixes) |
||
140 | } |
||
141 |