| Conditions | 4 |
| Paths | 4 |
| Total Lines | 21 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 12 | public function __invoke(array $array) |
||
| 13 | { |
||
| 14 | $result = []; |
||
| 15 | |||
| 16 | foreach ($array as $definition) { |
||
| 17 | if (false === array_key_exists('readme', $definition)) { |
||
| 18 | continue; |
||
| 19 | } |
||
| 20 | |||
| 21 | $composer = sprintf('%s%scomposer.json', dirname($definition['readme']), DIRECTORY_SEPARATOR); |
||
| 22 | |||
| 23 | if (false === file_exists($composer)) { |
||
| 24 | continue; |
||
| 25 | } |
||
| 26 | |||
| 27 | $definition['composer'] = $composer; |
||
| 28 | $result[] = $definition; |
||
| 29 | } |
||
| 30 | |||
| 31 | return $result; |
||
| 32 | } |
||
| 33 | } |
||
| 34 |