diff --git a/src/CeesVanEgmond/Minify/Minify.php b/src/CeesVanEgmond/Minify/Minify.php index b62c232..88dc03e 100644 --- a/src/CeesVanEgmond/Minify/Minify.php +++ b/src/CeesVanEgmond/Minify/Minify.php @@ -22,7 +22,7 @@ class Minify private $environment; /** - * @var + * @var \CeesVanEgmond\Minify\Providers\JavaScript */ private $provider; @@ -82,7 +82,7 @@ private function process($file) { $this->provider->add($file); - if($this->provider->make($this->buildPath)) + if($this->minifyForCurrentEnvironment() && $this->provider->make($this->buildPath)) { $this->provider->minify(); } @@ -93,7 +93,7 @@ private function process($file) */ public function render() { - if (in_array($this->environment, $this->config['ignore_environments'])) + if (!$this->minifyForCurrentEnvironment()) { return $this->provider->tags($this->attributes); } @@ -101,6 +101,14 @@ public function render() return $this->provider->tag($this->buildPath . $this->provider->getFilename(), $this->attributes); } + /** + * @return bool + */ + protected function minifyForCurrentEnvironment() + { + return !in_array($this->environment, $this->config['ignore_environments']); + } + /** * @return string */