Skip to content

Commit

Permalink
Change appending a new line to the buffer if not present
Browse files Browse the repository at this point in the history
  • Loading branch information
JackieDo committed Apr 14, 2020
1 parent 82aaec9 commit f54431c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Jackiedo/DotenvEditor/DotenvWriter.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,11 @@ protected function ensureFileIsWritable($filePath)
*/
public function setBuffer($content)
{
$this->buffer = trim($content) . PHP_EOL;
if (!empty($content)) {
$content = rtrim($content) . PHP_EOL;
}

$this->buffer = $content;

return $this;
}
Expand Down

0 comments on commit f54431c

Please sign in to comment.