Skip to content
This repository was archived by the owner on Mar 19, 2023. It is now read-only.

Commit 6dee727

Browse files
committed
Merge pull request #30 from jorygeerts/master
Changes for issue "ignore_environments"
2 parents 1508f9f + a60afe8 commit 6dee727

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/CeesVanEgmond/Minify/Minify.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ private function process($file)
8282
{
8383
$this->provider->add($file);
8484

85-
if($this->provider->make($this->buildPath))
85+
if($this->minifyForCurrentEnvironment() && $this->provider->make($this->buildPath))
8686
{
8787
$this->provider->minify();
8888
}
@@ -93,14 +93,22 @@ private function process($file)
9393
*/
9494
public function render()
9595
{
96-
if (in_array($this->environment, $this->config['ignore_environments']))
96+
if (!$this->minifyForCurrentEnvironment())
9797
{
9898
return $this->provider->tags($this->attributes);
9999
}
100100

101101
return $this->provider->tag($this->buildPath . $this->provider->getFilename(), $this->attributes);
102102
}
103103

104+
/**
105+
* @return bool
106+
*/
107+
protected function minifyForCurrentEnvironment()
108+
{
109+
return !in_array($this->environment, $this->config['ignore_environments']);
110+
}
111+
104112
/**
105113
* @return string
106114
*/

0 commit comments

Comments
 (0)