Просмотр исходного кода

Add newline at the end of formatted jsons

Jordi Boggiano 13 лет назад
Родитель
Сommit
d1d9c715c9
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      src/Composer/Json/JsonFile.php

+ 1 - 1
src/Composer/Json/JsonFile.php

@@ -104,7 +104,7 @@ class JsonFile
                 );
             }
         }
-        file_put_contents($this->path, static::encode($hash, $options));
+        file_put_contents($this->path, static::encode($hash, $options). ($options & JSON_PRETTY_PRINT ? "\n" : ''));
     }
 
     /**