1 | <?php |
||
10 | class ArrayParser implements ParserInterface |
||
11 | { |
||
12 | /** @var ParserInterface ExpressionParser parser for unserialize expression */ |
||
13 | private $expressionParser; |
||
14 | |||
15 | /** |
||
16 | * constructor |
||
17 | * |
||
18 | * @param ParserInterface $parser parser for unserialize expression |
||
19 | */ |
||
20 | 50 | public function __construct(ParserInterface $parser) |
|
24 | |||
25 | /** |
||
26 | * parse given `$source` as PHP serialized array |
||
27 | * |
||
28 | * @param Source $source parser input |
||
29 | * @return array |
||
30 | * @throws UnserializeFailedException |
||
31 | */ |
||
32 | 16 | public function parse(Source $source) |
|
47 | |||
48 | /** |
||
49 | * parse given `$source` as array key (s.t. integer|string) |
||
50 | * |
||
51 | * @param Source $source input |
||
52 | * @return array |
||
53 | * @throws UnserializeFailedException |
||
54 | */ |
||
55 | 5 | private function parseKey($source) |
|
69 | |||
70 | /** |
||
71 | * parse given `$source` as array value |
||
72 | * |
||
73 | * @param Source $source input |
||
74 | * @return array |
||
75 | * @throws UnserializeFailedException |
||
76 | */ |
||
77 | 4 | private function parseValue($source) |
|
81 | } |
||
82 |