diff --git a/README.md b/README.md index b30c5cd..eb86285 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ First you need [composer](https://getcomposer.org/) if you have not already. The use NodejsPhpFallback\Uglify; -// Require the composer autload in your PHP file if it's not already. +// Require the composer autoload in your PHP file if it's not already. // You do not need to if you use a framework with composer like Symfony, Laravel, etc. require 'vendor/autoload.php'; diff --git a/src/NodejsPhpFallback/Uglify.php b/src/NodejsPhpFallback/Uglify.php index 435e96a..6b0b208 100644 --- a/src/NodejsPhpFallback/Uglify.php +++ b/src/NodejsPhpFallback/Uglify.php @@ -37,12 +37,12 @@ public function add($file) public function getSource() { - $source = trim(parent::getSource()); + $source = parent::getSource(); foreach ($this->concat as $file) { if ($this->getMode() === 'js') { - $source = rtrim($source, '; ') . ';'; + $source .= "\n;"; } - $source .= trim(file_get_contents($file)); + $source .= "\n" . file_get_contents($file); } return $source;