Total Complexity | 3 |
Total Lines | 33 |
Duplicated Lines | 0 % |
Changes | 4 | ||
Bugs | 1 | Features | 1 |
1 | <?php |
||
10 | final class ComposerJson implements ComposerJsonInterface |
||
11 | { |
||
12 | public const FILE_NAME = 'composer.json'; |
||
13 | public const NAME_PROJECT_IN_COMPOSER = 'brucegithub/namespace-protector'; |
||
14 | |||
15 | /** @var string */ |
||
16 | private $fileSystemPathComposerJson; |
||
17 | |||
18 | /** @var array<string> */ |
||
19 | private $psr4Ns; |
||
20 | |||
21 | public function __construct(PathInterface $fileSystemPathComposerJson) |
||
28 | } |
||
29 | |||
30 | public function load(): void |
||
31 | { |
||
32 | $content = \safe\file_get_contents($this->fileSystemPathComposerJson); |
||
33 | |||
34 | $data = \safe\json_decode($content, true); |
||
35 | |||
36 | $this->psr4Ns = $data['autoload']['psr-4']; |
||
37 | } |
||
38 | |||
39 | /** @return array<string> */ |
||
40 | public function getPsr4Ns(): array |
||
43 | } |
||
44 | } |
||
45 |