@@ -123,6 +123,10 @@ discard block |
||
123 | 123 | } |
124 | 124 | |
125 | 125 | // hide everything between noptimize-comment tags |
126 | + |
|
127 | + /** |
|
128 | + * @param string $noptimize_in |
|
129 | + */ |
|
126 | 130 | protected function hide_noptimize($noptimize_in) { |
127 | 131 | if ( preg_match( '/<!--\s?noptimize\s?-->/', $noptimize_in ) ) { |
128 | 132 | $noptimize_out = preg_replace_callback( |
@@ -251,6 +255,9 @@ discard block |
||
251 | 255 | return $url; |
252 | 256 | } |
253 | 257 | |
258 | + /** |
|
259 | + * @param string $payload |
|
260 | + */ |
|
254 | 261 | protected function inject_in_html($payload,$replaceTag) { |
255 | 262 | if (strpos($this->content,$replaceTag[0])!== false) { |
256 | 263 | if ($replaceTag[1]==="after") { |
@@ -270,6 +277,9 @@ discard block |
||
270 | 277 | } |
271 | 278 | } |
272 | 279 | |
280 | + /** |
|
281 | + * @param string $tag |
|
282 | + */ |
|
273 | 283 | protected function isremovable($tag, $removables) { |
274 | 284 | foreach ($removables as $match) { |
275 | 285 | if (strpos($tag,$match)!==false) { |
@@ -280,6 +290,10 @@ discard block |
||
280 | 290 | } |
281 | 291 | |
282 | 292 | // inject already minified code in optimized JS/CSS |
293 | + |
|
294 | + /** |
|
295 | + * @return string |
|
296 | + */ |
|
283 | 297 | protected function inject_minified($in) { |
284 | 298 | if ( strpos( $in, '%%INJECTLATER%%' ) !== false ) { |
285 | 299 | $out = preg_replace_callback( |
@@ -42,6 +42,9 @@ discard block |
||
42 | 42 | return false; |
43 | 43 | } |
44 | 44 | |
45 | + /** |
|
46 | + * @param string $mime |
|
47 | + */ |
|
45 | 48 | public function cache($code,$mime) { |
46 | 49 | if($this->nogzip == false) { |
47 | 50 | $file = ($this->delayed ? 'delayed.php' : 'default.php'); |
@@ -240,6 +243,9 @@ discard block |
||
240 | 243 | return true; |
241 | 244 | } |
242 | 245 | |
246 | + /** |
|
247 | + * @param string $dir |
|
248 | + */ |
|
243 | 249 | static function checkCacheDir($dir) { |
244 | 250 | // Check and create if not exists |
245 | 251 | if(!file_exists($dir)) { |
@@ -625,6 +625,9 @@ |
||
625 | 625 | return false; |
626 | 626 | } |
627 | 627 | |
628 | + /** |
|
629 | + * @param string $url |
|
630 | + */ |
|
628 | 631 | private function getFutttaFeeds($url) { |
629 | 632 | if (apply_filters('autoptimize_settingsscreen_remotehttp',true)) { |
630 | 633 | $rss = fetch_feed( $url ); |
@@ -617,6 +617,9 @@ |
||
617 | 617 | return $code; |
618 | 618 | } |
619 | 619 | |
620 | + /** |
|
621 | + * @param string $tag |
|
622 | + */ |
|
620 | 623 | private function ismovable($tag) { |
621 | 624 | if (!empty($this->whitelist)) { |
622 | 625 | foreach ($this->whitelist as $match) { |
@@ -59,6 +59,9 @@ |
||
59 | 59 | |
60 | 60 | // -- Public Static Methods -------------------------------------------------- |
61 | 61 | |
62 | + /** |
|
63 | + * @param string $js |
|
64 | + */ |
|
62 | 65 | public static function minify($js) { |
63 | 66 | $jsmin = new JSMin($js); |
64 | 67 | return $jsmin->min(); |
@@ -53,7 +53,7 @@ |
||
53 | 53 | * |
54 | 54 | * @param array $options (currently ignored) |
55 | 55 | * |
56 | - * @return null |
|
56 | + * @return string |
|
57 | 57 | */ |
58 | 58 | private function __construct($options) { |
59 | 59 | $this->_options = $options; |
@@ -686,6 +686,11 @@ discard block |
||
686 | 686 | * --------------------------------------------------------------------------------------------- |
687 | 687 | */ |
688 | 688 | |
689 | + /** |
|
690 | + * @param double $v1 |
|
691 | + * @param double $v2 |
|
692 | + * @param integer $vh |
|
693 | + */ |
|
689 | 694 | private function hue_to_rgb($v1, $v2, $vh) |
690 | 695 | { |
691 | 696 | $vh = $vh < 0 ? $vh + 1 : ($vh > 1 ? $vh - 1 : $vh); |
@@ -700,6 +705,10 @@ discard block |
||
700 | 705 | return intval(floor(floatval($n) + 0.5), 10); |
701 | 706 | } |
702 | 707 | |
708 | + /** |
|
709 | + * @param integer $min |
|
710 | + * @param integer $max |
|
711 | + */ |
|
703 | 712 | private function clamp_number($n, $min, $max) |
704 | 713 | { |
705 | 714 | return min(max($n, $min), $max); |
@@ -728,7 +737,7 @@ discard block |
||
728 | 737 | * |
729 | 738 | * @param string $str |
730 | 739 | * @param int $start index |
731 | - * @param int|bool $end index (optional) |
|
740 | + * @param integer $end index (optional) |
|
732 | 741 | * @return string |
733 | 742 | */ |
734 | 743 | private function str_slice($str, $start = 0, $end = FALSE) |
@@ -686,6 +686,11 @@ discard block |
||
686 | 686 | * --------------------------------------------------------------------------------------------- |
687 | 687 | */ |
688 | 688 | |
689 | + /** |
|
690 | + * @param double $v1 |
|
691 | + * @param double $v2 |
|
692 | + * @param integer $vh |
|
693 | + */ |
|
689 | 694 | private function hue_to_rgb($v1, $v2, $vh) |
690 | 695 | { |
691 | 696 | $vh = $vh < 0 ? $vh + 1 : ($vh > 1 ? $vh - 1 : $vh); |
@@ -700,6 +705,10 @@ discard block |
||
700 | 705 | return intval(floor(floatval($n) + 0.5), 10); |
701 | 706 | } |
702 | 707 | |
708 | + /** |
|
709 | + * @param integer $min |
|
710 | + * @param integer $max |
|
711 | + */ |
|
703 | 712 | private function clamp_number($n, $min, $max) |
704 | 713 | { |
705 | 714 | return min(max($n, $min), $max); |
@@ -728,7 +737,7 @@ discard block |
||
728 | 737 | * |
729 | 738 | * @param string $str |
730 | 739 | * @param int $start index |
731 | - * @param int|bool $end index (optional) |
|
740 | + * @param integer $end index (optional) |
|
732 | 741 | * @return string |
733 | 742 | */ |
734 | 743 | private function str_slice($str, $start = 0, $end = FALSE) |