Conditions | 3 |
Paths | 3 |
Total Lines | 14 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 3 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
27 | 14 | public function load() |
|
28 | { |
||
29 | 14 | $entries = $this->parse($this->path); |
|
30 | |||
31 | 14 | if (!empty($this->rootKey)) { |
|
32 | 4 | if (!isset($entries[$this->rootKey])) { |
|
33 | 2 | throw new \InvalidArgumentException('Manifest file contains no '.$this->rootKey.' key'); |
|
34 | } |
||
35 | |||
36 | 2 | $entries = $entries[$this->rootKey]; |
|
37 | } |
||
38 | |||
39 | 12 | return new Manifest($entries); |
|
40 | } |
||
41 | |||
50 |
It is generally a best practice as it is often more readable to use concatenation instead of interpolation for variables inside strings.