فهرست منبع

Force empty lock files to contain a JSON object

By default it will make it an array, since PHP does not distinguish between
arrays and hash(map)s.
Igor Wiedler 13 سال پیش
والد
کامیت
1e5aaefaf5
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  1. 1 1
      src/Composer/Command/InstallCommand.php

+ 1 - 1
src/Composer/Command/InstallCommand.php

@@ -154,7 +154,7 @@ class InstallCommand
 
     protected function storeLockFile(array $content)
     {
-        file_put_contents('composer.lock', json_encode($content)."\n");
+        file_put_contents('composer.lock', json_encode($content, JSON_FORCE_OBJECT)."\n");
         echo '> composer.lock dumped'.PHP_EOL;
     }
 }