Conditions | 3 |
Paths | 4 |
Total Lines | 14 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
48 | public function getDataFrom(string $document): array |
||
49 | { |
||
50 | 3 | $baseTree = json_decode($document, true); |
|
51 | |||
52 | 3 | if (is_null($baseTree)) { |
|
53 | return []; |
||
54 | 3 | } |
|
55 | 1 | ||
56 | try { |
||
57 | $extractor = new $this->extractor($baseTree, $this->output); |
||
58 | |||
59 | 2 | return $extractor->extract(); |
|
60 | } catch (UnparseableApiException $e) { |
||
61 | 2 | return []; |
|
62 | 1 | } |
|
65 |