From 0056a769a760e78cccef73c720180386a6c9677b Mon Sep 17 00:00:00 2001 From: Boril Yordanov Date: Tue, 5 Feb 2019 17:43:30 +0200 Subject: [PATCH] Add a newline at the end of `.arc{config,lint}` --- CHANGELOG.md | 4 ++++ composer/ArcConfigParser.php | 7 +++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 30065f2..e9141f2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## 1.3.3 +### Fixed +- Add a newline at the end of `.arcconfig` and `.arclint` files. + ## 1.3.2 ### Fixed diff --git a/composer/ArcConfigParser.php b/composer/ArcConfigParser.php index 9a554e2..12a1891 100644 --- a/composer/ArcConfigParser.php +++ b/composer/ArcConfigParser.php @@ -31,7 +31,7 @@ public static function parseArcConfig(Event $event) file_put_contents( self::CONFIG_FILE, - stripslashes(json_encode($parsedConfig, JSON_PRETTY_PRINT)) + json_encode($parsedConfig, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) . PHP_EOL ); } @@ -94,7 +94,10 @@ private static function createOrUpdateArcLint($parsedConfig) $arcLint['linters']['php-cs-fixer']['unified_diff_format'] = $parsedConfig['lint.php_cs_fixer.unified_diff_format']; } - file_put_contents(self::LINT_FILE, stripslashes(json_encode($arcLint, JSON_PRETTY_PRINT))); + file_put_contents( + self::LINT_FILE, + json_encode($arcLint, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) . PHP_EOL + ); } private static function cleanArcConfig($parsedConfig)