1 | <?php |
||
16 | trait DocPosProviderTrait |
||
17 | { |
||
18 | /** |
||
19 | * The position of the doc comment or null. |
||
20 | * |
||
21 | * @var int|null |
||
22 | */ |
||
23 | private $docCommentPos = -1; |
||
24 | |||
25 | /** |
||
26 | * The used doc Helper. |
||
27 | * |
||
28 | * @var DocHelper |
||
29 | */ |
||
30 | private $docHelper = null; |
||
31 | |||
32 | /** |
||
33 | * The used file. |
||
34 | * |
||
35 | * @var File|void |
||
36 | */ |
||
37 | protected $file; |
||
38 | |||
39 | /** |
||
40 | * Position of the listened token. |
||
41 | * |
||
42 | * @var int|void |
||
43 | */ |
||
44 | protected $stackPos; |
||
45 | |||
46 | /** |
||
47 | * Returns the position of the doc block if there is one. |
||
48 | * |
||
49 | * @return int|null |
||
50 | */ |
||
51 | protected function getDocCommentPos(): ?int |
||
59 | |||
60 | /** |
||
61 | * Returns the helper for the doc block. |
||
62 | * |
||
63 | * @return DocHelper |
||
64 | */ |
||
65 | protected function getDocHelper(): DocHelper |
||
73 | |||
74 | /** |
||
75 | * Type safe getter for the file. |
||
76 | * |
||
77 | * @return File |
||
78 | */ |
||
79 | private function getFile(): File |
||
83 | |||
84 | /** |
||
85 | * Type safe getter for the stack position for this sniff. |
||
86 | * |
||
87 | * @return int |
||
88 | */ |
||
89 | private function getStackPos(): int |
||
93 | |||
94 | /** |
||
95 | * Loads the position of the doc comment. |
||
96 | * |
||
97 | * @return int|null |
||
98 | */ |
||
99 | protected function loadDocCommentPos(): ?int |
||
105 | |||
106 | /** |
||
107 | * Removes the cached data for the doc comment position. |
||
108 | * |
||
109 | * @return void |
||
110 | */ |
||
111 | protected function resetDocCommentPos(): void |
||
116 | } |
||
117 |