Conditions | 2 |
Paths | 2 |
Total Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php declare(strict_types=1); |
||
35 | 2 | protected function getCommandsCacheFilePath(Composer $composer): ?string |
|
36 | 2 | { |
|
37 | 2 | $extra = $composer->getPackage()->getExtra(); |
|
38 | 2 | $keyApp = CommandConstants::COMPOSER_JSON__EXTRA__APPLICATION; |
|
39 | 2 | $keyCacheFile = CommandConstants::COMPOSER_JSON__EXTRA__APPLICATION__COMMANDS_CACHE; |
|
40 | 2 | $commandsCacheFile = $extra[$keyApp][$keyCacheFile] ?? null; |
|
41 | if ($commandsCacheFile !== null) { |
||
42 | $appRootPath = $composer->getConfig()->get('vendor-dir') . DIRECTORY_SEPARATOR . '..'; |
||
43 | 2 | $commandsCacheFile = realpath($appRootPath) . DIRECTORY_SEPARATOR . $commandsCacheFile; |
|
44 | } |
||
45 | |||
46 | return $commandsCacheFile; |
||
47 | } |
||
48 | } |
||
49 |