Conditions | 2 |
Paths | 4 |
Total Lines | 21 |
Code Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Changes | 4 | ||
Bugs | 0 | Features | 2 |
1 | <?php |
||
25 | public function parse($filePath, $itemCallback) |
||
26 | { |
||
27 | $this->checkCallback($itemCallback); |
||
28 | |||
29 | $stream = $this->openFile($filePath); |
||
30 | |||
31 | try { |
||
32 | $listener = new Listener($itemCallback); |
||
33 | $this->parser = new \JsonStreamingParser\Parser( |
||
34 | $stream, |
||
35 | $listener, |
||
36 | $this->getOption('line_ending'), |
||
37 | $this->getOption('emit_whitespace') |
||
38 | ); |
||
39 | $this->parser->parse(); |
||
40 | } catch (\Exception $e) { |
||
41 | fclose($stream); |
||
42 | throw $e; |
||
43 | } |
||
44 | fclose($stream); |
||
45 | } |
||
46 | |||
110 |