Total Complexity | 5 |
Total Lines | 44 |
Duplicated Lines | 0 % |
Coverage | 61.53% |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
12 | class DependencyLoader implements DependencyLoaderContract |
||
13 | { |
||
14 | /** |
||
15 | * @var DependencyParser |
||
16 | */ |
||
17 | private $dependencyParser; |
||
18 | |||
19 | 2 | public function __construct(DependencyParser $dependencyParser) |
|
20 | { |
||
21 | 2 | $this->dependencyParser = $dependencyParser; |
|
22 | } |
||
23 | |||
24 | /** |
||
25 | * @throws CommandExecutionException |
||
26 | */ |
||
27 | 2 | public function loadDependencies(string $composer, string $project): array |
|
28 | { |
||
29 | 2 | $commandOutput = $this->runComposerLicenseCommand($composer, $project); |
|
30 | |||
31 | 1 | return $this->dependencyParser->parse(join(PHP_EOL, $commandOutput)); |
|
32 | } |
||
33 | |||
34 | /** |
||
35 | * @throws CommandExecutionException |
||
36 | */ |
||
37 | 2 | private function runComposerLicenseCommand(string $composer, string $project): array |
|
42 | } |
||
43 | |||
44 | /** |
||
45 | * @throws CommandExecutionException |
||
46 | */ |
||
47 | protected function exec(string $command): array |
||
58 |