1 | <?php |
||
12 | class Parser implements \Iterator |
||
13 | { |
||
14 | /** |
||
15 | * @var int |
||
16 | */ |
||
17 | private $position = 0; |
||
18 | |||
19 | /** |
||
20 | * @var int |
||
21 | */ |
||
22 | private $end = 0; |
||
23 | |||
24 | /** |
||
25 | * @var int |
||
26 | */ |
||
27 | private $execPtr = 0; |
||
28 | |||
29 | /** |
||
30 | * @var string |
||
31 | */ |
||
32 | private $data = ''; |
||
33 | |||
34 | /** |
||
35 | * @var Operation[] |
||
36 | */ |
||
37 | private $array = array(); |
||
38 | |||
39 | /** |
||
40 | * ScriptParser constructor. |
||
41 | * @param Math $math |
||
42 | * @param ScriptInterface $script |
||
43 | */ |
||
44 | 1119 | public function __construct(Math $math, ScriptInterface $script) |
|
52 | |||
53 | /** |
||
54 | * @return int |
||
55 | */ |
||
56 | public function getPosition() |
||
60 | |||
61 | /** |
||
62 | * @param string $packFormat |
||
63 | * @param integer $strSize |
||
64 | * @return array|bool |
||
65 | */ |
||
66 | 54 | private function unpackSize($packFormat, $strSize) |
|
77 | |||
78 | /** |
||
79 | * @param int $size |
||
80 | * @return bool |
||
81 | */ |
||
82 | 627 | private function validateSize($size) |
|
91 | |||
92 | /** |
||
93 | * @param int $ptr |
||
94 | * @return Operation |
||
95 | */ |
||
96 | 1035 | private function doNext($ptr) |
|
133 | |||
134 | /** |
||
135 | * |
||
136 | */ |
||
137 | 1083 | public function rewind() |
|
141 | |||
142 | /** |
||
143 | * @return Operation |
||
144 | */ |
||
145 | 1035 | public function current() |
|
155 | |||
156 | /** |
||
157 | * @return int |
||
158 | */ |
||
159 | public function key() |
||
163 | |||
164 | /** |
||
165 | * @return Operation |
||
166 | */ |
||
167 | 1065 | public function next() |
|
177 | |||
178 | /** |
||
179 | * @return bool |
||
180 | */ |
||
181 | 1083 | public function valid() |
|
185 | |||
186 | /** |
||
187 | * returns a mix of Buffer objects and strings |
||
188 | * |
||
189 | * @return Buffer[]|string[] |
||
190 | */ |
||
191 | 1011 | public function parse() |
|
212 | |||
213 | /** |
||
214 | * @return string |
||
215 | */ |
||
216 | 672 | public function getHumanReadable() |
|
231 | } |
||
232 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.