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 | * Returns the position of the doc block if there is one. |
||
34 | * |
||
35 | * @return int|null |
||
36 | */ |
||
37 | protected function getDocCommentPos(): ?int |
||
45 | |||
46 | /** |
||
47 | * Returns the helper for the doc block. |
||
48 | * |
||
49 | * @return DocHelper |
||
50 | */ |
||
51 | protected function getDocHelper(): DocHelper |
||
59 | |||
60 | /** |
||
61 | * Type-safe getter for the file. |
||
62 | * |
||
63 | * @return File |
||
64 | */ |
||
65 | abstract protected function getFile(): File; |
||
66 | |||
67 | /** |
||
68 | * Type-safe getter for the stack position. |
||
69 | * |
||
70 | * @return int |
||
71 | */ |
||
72 | abstract protected function getStackPos(): int; |
||
73 | |||
74 | /** |
||
75 | * Loads the position of the doc comment. |
||
76 | * |
||
77 | * @return int|null |
||
78 | */ |
||
79 | protected function loadDocCommentPos(): ?int |
||
85 | |||
86 | /** |
||
87 | * Removes the cached data for the doc comment position. |
||
88 | * |
||
89 | * @return void |
||
90 | */ |
||
91 | protected function resetDocCommentPos(): void |
||
96 | |||
97 | /** |
||
98 | * Removes the cached data. |
||
99 | * |
||
100 | * @return void |
||
101 | */ |
||
102 | protected function tearDown(): void |
||
106 | } |
||
107 |