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 | * Initializes the instance. |
||
47 | * |
||
48 | * @param string $name The function name. |
||
49 | * @param int $line The line where the function starts. |
||
50 | */ |
||
51 | public function __construct($name, $line) |
||
59 | |||
60 | /** |
||
61 | * Stop extracting strings from the current argument (because we found something that's not a string). |
||
62 | */ |
||
63 | public function stopArgument() |
||
70 | |||
71 | /** |
||
72 | * Go to the next argument because we a comma was found. |
||
73 | */ |
||
74 | public function nextArgument() |
||
84 | |||
85 | /** |
||
86 | * Add a string to the current argument. |
||
87 | * |
||
88 | * @param string $chunk |
||
89 | */ |
||
90 | public function addArgumentChunk($chunk) |
||
103 | |||
104 | /** |
||
105 | * A closing parenthesis was found: return the final data. |
||
106 | * |
||
107 | * @return array{ |
||
|
|||
108 | * |
||
109 | * @var string The function name. |
||
110 | * @var int The line where the function starts. |
||
111 | * @var string[] the strings extracted from the function arguments. |
||
112 | * } |
||
113 | */ |
||
114 | public function close() |
||
127 | } |
||
128 |
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.