| Conditions | 3 |
| Paths | 3 |
| Total Lines | 9 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 32 | function getComposerPackageName(string $basePath): ?string |
||
| 33 | { |
||
| 34 | $composerJsonFilePath = $basePath . '/composer.json'; |
||
| 35 | if (is_file($composerJsonFilePath)) { |
||
| 36 | $composerJson = FileSystem::read($composerJsonFilePath); |
||
| 37 | $composerJsonData = json_decode($composerJson, true); |
||
| 38 | return is_array($composerJsonData) ? (string)$composerJsonData['name'] : null; |
||
| 39 | } |
||
| 40 | throw new Exception('Not found composer.json on path: ' . $composerJsonFilePath); |
||
| 41 | } |
||
| 42 |