Conditions | 2 |
Paths | 2 |
Total Lines | 14 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
38 | 2 | public function load() |
|
39 | { |
||
40 | 2 | libxml_use_internal_errors(true); |
|
41 | 2 | $content = simplexml_load_file($this->entity); |
|
42 | |||
43 | 2 | if (!$content) { |
|
44 | 1 | throw new \RuntimeException( |
|
45 | 1 | sprintf("'%s' failed to load with the error '%s'", $this->entity, libxml_get_errors()[0]->message) |
|
46 | ); |
||
47 | } |
||
48 | |||
49 | 1 | $this->content = json_decode(json_encode($content), true); |
|
50 | 1 | return $this; |
|
51 | } |
||
52 | } |
||
53 |