diff --git a/src/PrettyVarExport.php b/src/PrettyVarExport.php index e97dbf3..21004b7 100644 --- a/src/PrettyVarExport.php +++ b/src/PrettyVarExport.php @@ -20,7 +20,7 @@ public function call($var, array $opts = []) . ($indexed ? '' : str_pad($key, $maxLength) . ' => ') . $this->call($value, array_merge($opts, ['indent' => $opts['indent'] . $opts['tab']])); } - return "[\n" . implode(",\n", $r) . "\n" . $opts['indent'] . "]"; + return "[\n" . implode(",\n", $r) . ",\n" . $opts['indent'] . "]"; case 'boolean': return $var ? 'true' : 'false'; case 'NULL': diff --git a/src/SourceSaver.php b/src/SourceSaver.php index 009d1ab..6e75e97 100644 --- a/src/SourceSaver.php +++ b/src/SourceSaver.php @@ -58,9 +58,11 @@ public function call($sourceEdit, $sourceLocale) $translations = $this->applySourceEditInTranslations($translations, $sourceEdit); + // Leave the extra newline at the end $fileContent = <<<'EOT' prettyVarExport->call($translations, ['array-align' => true]); diff --git a/src/TranslationSaver.php b/src/TranslationSaver.php index 6325238..865ad8d 100644 --- a/src/TranslationSaver.php +++ b/src/TranslationSaver.php @@ -69,9 +69,11 @@ private function save($locale, $group, $translations) $this->filesystem->makeDirectory($dir, 0777, true, true); + // Leave the extra newline at the end $fileContent = <<<'EOT' prettyVarExport->call($translations, ['array-align' => true]);