Completed
Pull Request — master (#254)
by
unknown
02:09
created
classes/autoptimizeBase.php 1 patch
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
      *
65 65
      * @param string $url URL to transform.
66 66
      *
67
-     * @return bool|string
67
+     * @return false|string
68 68
      */
69 69
     public function getpath( $url )
70 70
     {
@@ -610,7 +610,7 @@  discard block
 block discarded – undo
610 610
     /**
611 611
      * Logs given `$data` for debugging purposes (when debug logging is on).
612 612
      *
613
-     * @param mixed $data Data to log.
613
+     * @param string $data Data to log.
614 614
      *
615 615
      * @return void
616 616
      */
@@ -632,7 +632,7 @@  discard block
 block discarded – undo
632 632
      *
633 633
      * @param string $filepath Filepath.
634 634
      *
635
-     * @return bool|string to be minified code or false.
635
+     * @return false|string to be minified code or false.
636 636
      */
637 637
     protected function prepare_minify_single( $filepath )
638 638
     {
Please login to merge, or discard this patch.
classes/autoptimizeCache.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -434,7 +434,7 @@
 block discarded – undo
434 434
      * size = total filesize (in bytes) of found files
435 435
      * timestamp = unix timestamp when the scan was last performed/finished.
436 436
      *
437
-     * @return array
437
+     * @return integer[]
438 438
      */
439 439
     protected static function stats_scan()
440 440
     {
Please login to merge, or discard this patch.
classes/autoptimizeConfig.php 1 patch
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -752,6 +752,9 @@  discard block
 block discarded – undo
752 752
         return $preload_onload;
753 753
     }
754 754
 
755
+    /**
756
+     * @param string $key
757
+     */
755 758
     public function get($key)
756 759
     {
757 760
         if ( ! is_array( $this->config ) ) {
@@ -778,6 +781,9 @@  discard block
 block discarded – undo
778 781
         return false;
779 782
     }
780 783
 
784
+    /**
785
+     * @param string $url
786
+     */
781 787
     private function getFutttaFeeds($url) {
782 788
         if ( $this->settings_screen_do_remote_http ) {
783 789
             $rss = fetch_feed( $url );
Please login to merge, or discard this patch.
classes/autoptimizeMain.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -253,7 +253,7 @@
 block discarded – undo
253 253
      *
254 254
      * @param bool $doing_tests Allows overriding the optimization of only
255 255
      *                          deciding once per request (for use in tests).
256
-     * @return bool
256
+     * @return boolean|null
257 257
      */
258 258
     public function should_buffer( $doing_tests = false )
259 259
     {
Please login to merge, or discard this patch.
classes/autoptimizeScripts.php 1 patch
Doc Comments   +9 added lines, -1 removed lines patch added patch discarded remove patch
@@ -418,6 +418,10 @@  discard block
 block discarded – undo
418 418
     }
419 419
 
420 420
     // Checks against the white- and blacklists
421
+
422
+    /**
423
+     * @param string $tag
424
+     */
421 425
     private function ismergeable($tag)
422 426
     {
423 427
         if ( ! $this->aggregate ) {
@@ -457,6 +461,10 @@  discard block
 block discarded – undo
457 461
     }
458 462
 
459 463
     // Checks agains the blacklist
464
+
465
+    /**
466
+     * @param string $tag
467
+     */
460 468
     private function ismovable($tag)
461 469
     {
462 470
         if ( true !== $this->include_inline || apply_filters( 'autoptimize_filter_js_unmovable', true ) ) {
@@ -538,7 +546,7 @@  discard block
 block discarded – undo
538 546
      * @param string $filepath Filepath.
539 547
      * @param bool $cache_miss Optional. Force a cache miss. Default false.
540 548
      *
541
-     * @return bool|string Url pointing to the minified js file or false.
549
+     * @return false|string Url pointing to the minified js file or false.
542 550
      */
543 551
     public function minify_single( $filepath, $cache_miss = false )
544 552
     {
Please login to merge, or discard this patch.
classes/autoptimizeStyles.php 1 patch
Doc Comments   +19 added lines, -2 removed lines patch added patch discarded remove patch
@@ -282,7 +282,7 @@  discard block
 block discarded – undo
282 282
      * be inlined into a data: URI. Defaults to 4096, passed through
283 283
      * `autoptimize_filter_css_datauri_maxsize` filter.
284 284
      *
285
-     * @return mixed
285
+     * @return integer|null
286 286
      */
287 287
     private function get_datauri_maxsize()
288 288
     {
@@ -303,6 +303,9 @@  discard block
 block discarded – undo
303 303
         return $max_size;
304 304
     }
305 305
 
306
+    /**
307
+     * @param false|string $url
308
+     */
306 309
     private function check_datauri_exclude_list( $url )
307 310
     {
308 311
         static $exclude_list = null;
@@ -328,6 +331,9 @@  discard block
 block discarded – undo
328 331
         return $matched;
329 332
     }
330 333
 
334
+    /**
335
+     * @param false|string $path
336
+     */
331 337
     private function build_or_get_datauri_image( $path )
332 338
     {
333 339
         /**
@@ -746,6 +752,11 @@  discard block
 block discarded – undo
746 752
         return true;
747 753
     }
748 754
 
755
+    /**
756
+     * @param string $code
757
+     *
758
+     * @return string
759
+     */
749 760
     public function run_minifier_on( $code )
750 761
     {
751 762
         if ( ! $this->alreadyminified ) {
@@ -945,6 +956,9 @@  discard block
 block discarded – undo
945 956
         return $code;
946 957
     }
947 958
 
959
+    /**
960
+     * @param string $tag
961
+     */
948 962
     private function ismovable( $tag )
949 963
     {
950 964
         if ( ! $this->aggregate ) {
@@ -1005,7 +1019,7 @@  discard block
 block discarded – undo
1005 1019
      * @param string $filepath Filepath.
1006 1020
      * @param bool   $cache_miss Optional. Force a cache miss. Default false.
1007 1021
      *
1008
-     * @return bool|string Url pointing to the minified css file or false.
1022
+     * @return false|string Url pointing to the minified css file or false.
1009 1023
      */
1010 1024
     public function minify_single( $filepath, $cache_miss = false )
1011 1025
     {
@@ -1057,6 +1071,9 @@  discard block
 block discarded – undo
1057 1071
         $this->options = $options;
1058 1072
     }
1059 1073
 
1074
+    /**
1075
+     * @param string $name
1076
+     */
1060 1077
     public function setOption( $name, $value )
1061 1078
     {
1062 1079
         $this->options[$name] = $value;
Please login to merge, or discard this patch.
classes/autoptimizeUtils.php 1 patch
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
      *
15 15
      * @param bool|null $override Allows overriding the decision.
16 16
      *
17
-     * @return bool
17
+     * @return boolean|null
18 18
      */
19 19
     public static function mbstring_available( $override = null )
20 20
     {
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
      *
131 131
      * @param bool $override Allows overriding the decision when needed.
132 132
      *
133
-     * @return bool
133
+     * @return boolean|null
134 134
      */
135 135
     public static function siteurl_not_root( $override = null )
136 136
     {
Please login to merge, or discard this patch.
tests/test-ao.php 1 patch
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -128,6 +128,9 @@
 block discarded – undo
128 128
         parent::tearDown();
129 129
     }
130 130
 
131
+    /**
132
+     * @return string
133
+     */
131 134
     protected function get_test_markup()
132 135
     {
133 136
         $siteurl = $this->get_urls()['siteurl'];
Please login to merge, or discard this patch.
classes/autoptimizeImages.php 1 patch
Doc Comments   +13 added lines, -1 removed lines patch added patch discarded remove patch
@@ -358,6 +358,9 @@  discard block
 block discarded – undo
358 358
         }
359 359
     }
360 360
 
361
+    /**
362
+     * @return string
363
+     */
361 364
     private function get_imgopt_base_url()
362 365
     {
363 366
         static $imgopt_base_url = null;
@@ -693,6 +696,9 @@  discard block
 block discarded – undo
693 696
         return $out;
694 697
     }
695 698
 
699
+    /**
700
+     * @param string $tag
701
+     */
696 702
     public function add_lazyload( $tag, $placeholder = '' ) {
697 703
         // adds actual lazyload-attributes to an image node.
698 704
         if ( str_ireplace( $this->get_lazyload_exclusions(), '', $tag ) === $tag ) {
@@ -781,6 +787,9 @@  discard block
 block discarded – undo
781 787
         return $exclude_lazyload_array;
782 788
     }
783 789
 
790
+    /**
791
+     * @param string $target_class
792
+     */
784 793
     public function inject_classes_in_tag( $tag, $target_class ) {
785 794
         if ( strpos( $tag, 'class=' ) !== false ) {
786 795
             $tag = preg_replace( '/(\sclass\s?=\s?("|\'))/', '$1' . $target_class, $tag );
@@ -810,6 +819,9 @@  discard block
 block discarded – undo
810 819
         return $webp_return;
811 820
     }
812 821
 
822
+    /**
823
+     * @return string
824
+     */
813 825
     public function process_picture_tag( $in, $imgopt = false, $lazy = false ) {
814 826
         // check if "<picture" is present and if filter allows us to process <picture>.
815 827
         if ( strpos( $in, '<picture' ) === false || apply_filters( 'autoptimize_filter_imgopt_dopicture', true ) === false ) {
@@ -1141,7 +1153,7 @@  discard block
 block discarded – undo
1141 1153
     /**
1142 1154
      * Determines and returns the service launch status.
1143 1155
      *
1144
-     * @return bool
1156
+     * @return null|boolean
1145 1157
      */
1146 1158
     public function launch_ok()
1147 1159
     {
Please login to merge, or discard this patch.