Conditions | 2 |
Paths | 2 |
Total Lines | 11 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 6 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
38 | public function getComposerJsonContentAsArray(): array |
||
39 | { |
||
40 | $filename = $this->getAppRootDir() . '/composer.json'; |
||
41 | if (!file_exists($filename)) { |
||
42 | throw new LogicException('composer.json file not found but it is required'); |
||
43 | } |
||
44 | |||
45 | /** @var array{autoload: array{psr-4: array<string,string>}} $json */ |
||
46 | $json = (array)json_decode((string)file_get_contents($filename), true, 512, JSON_THROW_ON_ERROR); |
||
47 | |||
48 | return $json; |
||
49 | } |
||
56 |