Conditions | 5 |
Paths | 3 |
Total Lines | 20 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
25 | public function __invoke(array $array) |
||
26 | { |
||
27 | $result = []; |
||
28 | $json = json_decode(file_get_contents($this->installed), true); |
||
29 | |||
30 | foreach ($array as $definition) { |
||
31 | if (false === array_key_exists('package', $definition)) { |
||
32 | continue; |
||
33 | } |
||
34 | |||
35 | foreach ($json as $installed) { |
||
36 | if ($installed['name'] === $definition['package']) { |
||
37 | $definition['version'] = $installed['version']; |
||
38 | $result[] = $definition; |
||
39 | } |
||
40 | } |
||
41 | } |
||
42 | |||
43 | return $result; |
||
44 | } |
||
45 | } |
||
46 |