From 029b3882e9b904ab14079e60e4e59dc9d13183bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=93=AD=E6=98=95?= <715557344@qq.com> Date: Fri, 2 Aug 2019 10:18:04 +0800 Subject: [PATCH] Update composer-json-fixer --- bin/composer-json-fixer | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bin/composer-json-fixer b/bin/composer-json-fixer index e8d20fa34..aac54a261 100755 --- a/bin/composer-json-fixer +++ b/bin/composer-json-fixer @@ -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)