Update composer-json-fixer

This commit is contained in:
李铭昕 2019-08-02 10:18:04 +08:00
parent 1a3ddb2683
commit 029b3882e9

View File

@ -33,13 +33,16 @@ foreach ($files as $file) {
$configProviders = array_merge($configProviders, (array)$composerJson['extra']['hyperf']['config']);
}
}
ksort($autoload);
ksort($autoloadDev);
sort($configProviders);
$json = json_decode(file_get_contents(__DIR__ . '/../composer.json'));
$json->autoload->{'psr-4'} = $autoload;
$json->{'autoload-dev'}->{'psr-4'} = $autoloadDev;
$json->extra->hyperf->config = $configProviders;
file_put_contents(
__DIR__ . '/../composer.json',
json_encode($json, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT)