Skip to content

Commit

Permalink
Merge pull request #32 from ashokadewit/master
Browse files Browse the repository at this point in the history
Append a newline to the buffer if not present
  • Loading branch information
JackieDo authored Apr 12, 2020
2 parents c86505d + 36ec113 commit 189ec00
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Jackiedo/DotenvEditor/DotenvWriter.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ protected function ensureFileIsWritable($filePath)
*/
public function setBuffer($content)
{
if ($content !== '' && substr($content, -1) !== PHP_EOL) {
$content .= PHP_EOL;
}

$this->buffer = $content;
return $this;
}
Expand Down

0 comments on commit 189ec00

Please sign in to comment.