Permalink
Browse files

Merging in pull request #8 and making some changes. Making the struct…

…ure more PSR-2 compliant.
  • Loading branch information...
Cody Lundquist
Cody Lundquist committed Apr 13, 2013
1 parent dd8f9ad commit fd16f78a91674051a2b91495f8122e911b498be5
View
@@ -25,5 +25,8 @@
"imagine/Imagine": "*",
"coffeescript/coffeescript": "*",
"meenie/javascript-packer": "*"
},
"require-dev": {
"phpunit/phpunit": "3.7.*"
}
}
@@ -18,14 +18,14 @@
/**
* @var array
*/
protected $_allowedParams = array();
protected $allowedParams = array();
/**
* @return array
*/
public function getAllowedParams()
{
return $this->_allowedParams;
return $this->allowedParams;
}
/**
@@ -21,7 +21,7 @@ class Minify extends Filter
/**
* @var array
*/
protected $_allowedParams = array(
protected $allowedParams = array(
'minify' => array(
'regex' => 'true|false|t|f|yes|no|y|n',
'default' => 'false',
@@ -46,10 +46,10 @@ public function doFilter($file, $arguments, $cssOptions)
$content = file_get_contents($file);
if (Utils::isSerialized($content, $content)) {
$content['compiled'] = $this->_minify($content['compiled']);
$content['compiled'] = $this->minify($content['compiled']);
$content = serialize($content);
} else {
$content = $this->_minify($content);
$content = $this->minify($content);
}
file_put_contents($file, $content);
@@ -62,7 +62,7 @@ public function doFilter($file, $arguments, $cssOptions)
*
* @return string
*/
protected function _minify($content)
protected function minify($content)
{
$regexs = array(
// Remove Comments
@@ -22,7 +22,7 @@ class Colorize extends Filter
/**
* @var array
*/
protected $_allowedParams = array(
protected $allowedParams = array(
'colorize' => array(
'regex' => '[A-Fa-f0-9]{3}$|^[A-Fa-f0-9]{6}',
'cast' => 'string'
@@ -34,10 +34,11 @@ class Colorize extends Filter
*
* @param string $file
* @param array $arguments
* @param array $typeOptions
*
* @return void
*/
public function doFilter($file, $arguments)
public function doFilter($file, $arguments, $typeOptions)
{
$Imagine = new Imagine();
$image = $Imagine->open($file);
@@ -21,7 +21,7 @@ class Grayscale extends Filter
/**
* @var array
*/
protected $_allowedParams = array(
protected $allowedParams = array(
'grayscale' => array(
'regex' => 'true|false|t|f|yes|no|y|n',
'default' => 'false',
@@ -34,10 +34,11 @@ class Grayscale extends Filter
*
* @param string $file
* @param array $arguments
* @param array $typeOptions
*
* @return void
*/
public function doFilter($file, $arguments)
public function doFilter($file, $arguments, $typeOptions)
{
if (! $arguments['grayscale']) {
return;
@@ -21,7 +21,7 @@ class Negative extends Filter
/**
* @var array
*/
protected $_allowedParams = array(
protected $allowedParams = array(
'negative' => array(
'regex' => 'true|false|t|f|yes|no|y|n',
'cast' => 'string'
@@ -33,10 +33,11 @@ class Negative extends Filter
*
* @param string $file
* @param array $arguments
* @param array $typeOptions
*
* @return void
*/
public function doFilter($file, $arguments)
public function doFilter($file, $arguments, $typeOptions)
{
$Imagine = new Imagine();
$image = $Imagine->open($file);
@@ -25,7 +25,7 @@ class Resize extends Filter
/**
* @var array
*/
protected $_allowedParams = array(
protected $allowedParams = array(
'resize' => array(
'arguments' => array(
'width' => array(
@@ -21,7 +21,7 @@ class Minify extends Filter
/**
* @var array
*/
protected $_allowedParams = array(
protected $allowedParams = array(
'minify' => array(
'regex' => 'true|false|t|f|yes|no|y|n',
'default' => 'false',
@@ -21,7 +21,7 @@ class Packer extends Filter
/**
* @var array
*/
protected $_allowedParams = array(
protected $allowedParams = array(
'packer' => array(
'regex' => 'true|false|t|f|yes|no|y|n',
'default' => 'false',
Oops, something went wrong.

0 comments on commit fd16f78

Please sign in to comment.