Conditions | 2 |
Paths | 2 |
Total Lines | 9 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php declare(strict_types=1); |
||
36 | 2 | public static function getComposerJsonDecoded(string $path = null): array |
|
37 | { |
||
38 | 2 | $path = $path ?? self::getProjectRootDirectory().'/composer.json'; |
|
39 | 2 | $decoded = \json_decode(\file_get_contents($path), true); |
|
40 | 2 | if (JSON_ERROR_NONE !== \json_last_error()) { |
|
41 | 1 | throw new \RuntimeException('Failed loading composer.json: '.\json_last_error_msg()); |
|
42 | } |
||
43 | |||
44 | 1 | return $decoded; |
|
45 | } |
||
47 |