Conditions | 2 |
Paths | 2 |
Total Lines | 9 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php declare(strict_types=1); |
||
44 | public static function getComposerJsonDecoded(string $path = null): array |
||
45 | { |
||
46 | $path = $path ?? self::getProjectRootDirectory().'/composer.json'; |
||
47 | $decoded = \json_decode(\file_get_contents($path), true); |
||
48 | if (JSON_ERROR_NONE !== \json_last_error()) { |
||
49 | throw new \RuntimeException('Failed loading composer.json: '.\json_last_error_msg()); |
||
50 | } |
||
51 | |||
52 | return $decoded; |
||
53 | } |
||
55 |