1 | <?php |
||
8 | class ParsedFunction |
||
9 | { |
||
10 | /** |
||
11 | * The function name. |
||
12 | * |
||
13 | * @var string |
||
14 | */ |
||
15 | protected $name; |
||
16 | |||
17 | /** |
||
18 | * The line where the function starts. |
||
19 | * |
||
20 | * @var int |
||
21 | */ |
||
22 | protected $line; |
||
23 | |||
24 | /** |
||
25 | * The strings extracted from the function arguments. |
||
26 | * |
||
27 | * @var string[] |
||
28 | */ |
||
29 | protected $arguments; |
||
30 | |||
31 | /** |
||
32 | * The current index of the function (-1 if no arguments). |
||
33 | * |
||
34 | * @var int|null |
||
35 | */ |
||
36 | protected $argumentIndex; |
||
37 | |||
38 | /** |
||
39 | * Shall we stop adding string chunks to the current argument? |
||
40 | * |
||
41 | * @var bool |
||
42 | */ |
||
43 | protected $argumentStopped; |
||
44 | |||
45 | /** |
||
46 | * Extracted comments. |
||
47 | * |
||
48 | * @var string[]|null |
||
49 | */ |
||
50 | protected $comments; |
||
51 | |||
52 | /** |
||
53 | * Initializes the instance. |
||
54 | * |
||
55 | * @param string $name The function name. |
||
56 | * @param int $line The line where the function starts. |
||
57 | */ |
||
58 | public function __construct($name, $line) |
||
67 | |||
68 | /** |
||
69 | * Stop extracting strings from the current argument (because we found something that's not a string). |
||
70 | */ |
||
71 | public function stopArgument() |
||
78 | |||
79 | /** |
||
80 | * Go to the next argument because we a comma was found. |
||
81 | */ |
||
82 | public function nextArgument() |
||
92 | |||
93 | /** |
||
94 | * Add a string to the current argument. |
||
95 | * |
||
96 | * @param string $chunk |
||
97 | */ |
||
98 | public function addArgumentChunk($chunk) |
||
111 | |||
112 | /** |
||
113 | * Add a comment associated to this function. |
||
114 | * |
||
115 | * @param string $comment |
||
116 | */ |
||
117 | public function addComment($comment) |
||
124 | /** |
||
125 | * A closing parenthesis was found: return the final data. |
||
126 | * |
||
127 | * @return array{ |
||
|
|||
128 | * |
||
129 | * @var string The function name. |
||
130 | * @var int The line where the function starts. |
||
131 | * @var string[] the strings extracted from the function arguments. |
||
132 | * @var string[] the comments associated to the function. |
||
133 | * } |
||
134 | */ |
||
135 | public function close() |
||
149 | } |
||
150 |
This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.