1 | <?php |
||
17 | class DocHelper |
||
18 | { |
||
19 | /** |
||
20 | * The php cs file. |
||
21 | * |
||
22 | * @var File |
||
23 | */ |
||
24 | private $file; |
||
25 | |||
26 | /** |
||
27 | * Pointer to the token which is to be listened. |
||
28 | * |
||
29 | * @var int |
||
30 | */ |
||
31 | private $stackPtr; |
||
32 | |||
33 | /** |
||
34 | * Token stack of the current file. |
||
35 | * |
||
36 | * @var array |
||
37 | */ |
||
38 | private $tokens; |
||
39 | |||
40 | /** |
||
41 | * DocHelper constructor. |
||
42 | * |
||
43 | * @param File $file File object of file which is processed. |
||
44 | * @param int $stackPtr Pointer to the token which is processed. |
||
45 | */ |
||
46 | 121 | public function __construct(File $file, $stackPtr) |
|
52 | |||
53 | /** |
||
54 | * Checks if a comment for the class exists. |
||
55 | * |
||
56 | * @param int $listenerPtr Pointer of the listener token |
||
57 | * @param bool $isVariable Is the current token a variable |
||
58 | * |
||
59 | * @return bool Indicator if the comment exists or not |
||
60 | 121 | */ |
|
61 | public function checkCommentExists(int $listenerPtr, bool $isVariable): bool |
||
83 | |||
84 | /** |
||
85 | 117 | * Checks if the comment is multi line. |
|
86 | * |
||
87 | 117 | * @param bool $isVariable Is the current token a variable |
|
88 | 117 | * |
|
89 | * @return bool Indicator if the comment is multiline |
||
90 | 117 | */ |
|
91 | 4 | public function checkCommentMultiLine(bool $isVariable): bool |
|
108 | 117 | ||
109 | /** |
||
110 | 117 | * Returns pointer to the class comment start. |
|
111 | * |
||
112 | 117 | * @return int Pointer to the class comment start. |
|
113 | */ |
||
114 | public function getCommentStartPointer(): int |
||
120 | 117 | ||
121 | /** |
||
122 | 117 | * Returns token data of the evaluated class comment start. |
|
123 | * |
||
124 | 117 | * @return array Token data of the comment start. |
|
125 | */ |
||
126 | public function getCommentStartToken(): array |
||
132 | 121 | ||
133 | /** |
||
134 | 121 | * Returns pointer to the class comment end. |
|
135 | 121 | * |
|
136 | 121 | * @return int Pointer to the class comment end. |
|
137 | */ |
||
138 | public function getCommentEndPointer(): int |
||
152 | 121 | ||
153 | /** |
||
154 | 121 | * Returns token data of the evaluated class comment end. |
|
155 | * |
||
156 | * @return array Token data of the comment end. |
||
157 | */ |
||
158 | public function getCommentEndToken(): array |
||
162 | } |
||
163 |