diff --git a/src/MinifyCSS.php b/src/MinifyCSS.php index 947de8e..d63f892 100644 --- a/src/MinifyCSS.php +++ b/src/MinifyCSS.php @@ -6,19 +6,44 @@ use MatthiasMullie\Minify; +/** + * [Description MinifyCSS]. + */ class MinifyCSS extends ShrinkWrap { + /** + * @var array + */ private $available_engines = ['matthiasmullie', 'regex']; + /** + * @var string + */ private $engine; + + /** + * @var array + */ private $options; + /** + * @var mixed + */ private $minifier; + /** + * @param string $engine + * @param array $options + */ public function __construct(string $engine = 'matthiasmullie', array $options = []) { in_array($engine, $this->available_engines) ? $this->engine = $engine : $this->engine = 'matthiasmullie'; $this->options = $options; } + /** + * @param null|string $data + * + * @return null|mixed + */ public function init(string $data = null) { switch ($this->engine) { case 'matthiasmullie': @@ -28,6 +53,11 @@ public function init(string $data = null) { } } + /** + * @param null|string $data + * + * @return null|mixed + */ public function minify(string $data = null) { switch ($this->engine) { case 'matthiasmullie': @@ -35,6 +65,11 @@ public function minify(string $data = null) { } } + /** + * @param string $data + * + * @return null|mixed + */ public function add(string $data) { switch ($this->engine) { case 'matthiasmullie': diff --git a/src/MinifyHTML.php b/src/MinifyHTML.php index 7602536..dca9812 100644 --- a/src/MinifyHTML.php +++ b/src/MinifyHTML.php @@ -6,14 +6,33 @@ use voku\helper\HtmlMin; +/** + * [Description MinifyHTML]. + */ class MinifyHTML extends ShrinkWrap { + /** + * @var array + */ private $available_engines = ['voku', 'regex']; + /** + * @var string + */ private $engine; + + /** + * @var array + */ private $options; + /** + * @var mixed + */ private $minifier; + /** + * @var array + */ private $voku_options = [ 'doOptimizeViaHtmlDomParser' => false, // optimize html via "HtmlDomParser()" 'doRemoveComments' => false, // remove default HTML comments (depends on "doOptimizeViaHtmlDomParser(true)") @@ -41,11 +60,20 @@ class MinifyHTML extends ShrinkWrap { 'doRemoveOmittedHtmlTags' => false, // remove ommitted html tags e.g.

lall

=>

lall ]; + /** + * @param string $engine + * @param array $options + */ public function __construct(string $engine = 'voku', array $options = []) { in_array($engine, $this->available_engines) ? $this->engine = $engine : $this->engine = 'voku'; $this->options = $options; } + /** + * @param null|string $data + * + * @return null|mixed + */ public function init(string $data = null) { switch ($this->engine) { case 'voku': @@ -62,6 +90,11 @@ public function init(string $data = null) { } } + /** + * @param null|string $data + * + * @return null|mixed + */ public function minify(string $data = null) { switch ($this->engine) { case 'voku': diff --git a/src/MinifyJS.php b/src/MinifyJS.php index 8ad3047..bf2d21e 100644 --- a/src/MinifyJS.php +++ b/src/MinifyJS.php @@ -6,19 +6,44 @@ use MatthiasMullie\Minify; +/** + * [Description MinifyJS]. + */ class MinifyJS extends ShrinkWrap { + /** + * @var array + */ private $available_engines = ['matthiasmullie', 'regex']; + /** + * @var string + */ private $engine; + + /** + * @var array + */ private $options; + /** + * @var mixed + */ private $minifier; + /** + * @param string $engine + * @param array $options + */ public function __construct(string $engine = 'matthiasmullie', array $options = []) { in_array($engine, $this->available_engines) ? $this->engine = $engine : $this->engine = 'matthiasmullie'; $this->options = $options; } + /** + * @param null|string $data + * + * @return null|mixed + */ public function init(string $data = null) { switch ($this->engine) { case 'matthiasmullie': @@ -28,6 +53,11 @@ public function init(string $data = null) { } } + /** + * @param null|string $data + * + * @return null|mixed + */ public function minify(string $data = null) { switch ($this->engine) { case 'matthiasmullie': @@ -35,6 +65,11 @@ public function minify(string $data = null) { } } + /** + * @param string $data + * + * @return null|mixed + */ public function add(string $data) { switch ($this->engine) { case 'matthiasmullie': diff --git a/src/ShrinkWrap.php b/src/ShrinkWrap.php index 0d789cb..ec6479d 100644 --- a/src/ShrinkWrap.php +++ b/src/ShrinkWrap.php @@ -98,6 +98,10 @@ public function __construct() { $this->domparser = new HTML5(); } + /** + * @param mixed $method + * @param mixed $args + */ public function __call($method, $args) { echo "Calling unknown object method '{$method}' " . json_encode($args) . "\n"; }