@@ -149,6 +149,9 @@ discard block |
||
149 | 149 | |
150 | 150 | /** |
151 | 151 | * Helper function for Jetpack_Color::fromHsl() |
152 | + * @param double $p |
|
153 | + * @param double $q |
|
154 | + * @param integer $t |
|
152 | 155 | */ |
153 | 156 | private function hue2rgb( $p, $q, $t ) { |
154 | 157 | if ( $t < 0 ) $t += 1; |
@@ -278,7 +281,7 @@ discard block |
||
278 | 281 | * Get HSV values for color |
279 | 282 | * (integer values from 0-255, fast but less accurate) |
280 | 283 | * |
281 | - * @return int |
|
284 | + * @return string |
|
282 | 285 | */ |
283 | 286 | public function toHsvInt() |
284 | 287 | { |
@@ -498,7 +501,7 @@ discard block |
||
498 | 501 | * |
499 | 502 | * @param Jetpack_Color $color |
500 | 503 | * |
501 | - * @return int |
|
504 | + * @return double |
|
502 | 505 | */ |
503 | 506 | public function getDistanceRgbFrom(Jetpack_Color $color) |
504 | 507 | { |
@@ -682,6 +685,9 @@ discard block |
||
682 | 685 | return $this->incrementLightness( $amount ); |
683 | 686 | } |
684 | 687 | |
688 | + /** |
|
689 | + * @param integer $amount |
|
690 | + */ |
|
685 | 691 | public function incrementLightness( $amount ) { |
686 | 692 | $hsl = $this->toHsl(); |
687 | 693 | extract( $hsl ); |
@@ -699,6 +705,9 @@ discard block |
||
699 | 705 | return $this->incrementSaturation( - $amount ); |
700 | 706 | } |
701 | 707 | |
708 | + /** |
|
709 | + * @param integer $amount |
|
710 | + */ |
|
702 | 711 | public function incrementSaturation( $amount ) { |
703 | 712 | $hsl = $this->toHsl(); |
704 | 713 | extract( $hsl ); |
@@ -739,6 +748,9 @@ discard block |
||
739 | 748 | return $this->incrementHue( $incr ); |
740 | 749 | } |
741 | 750 | |
751 | + /** |
|
752 | + * @param integer $amount |
|
753 | + */ |
|
742 | 754 | public function incrementHue( $amount ) { |
743 | 755 | $hsl = $this->toHsl(); |
744 | 756 | extract( $hsl ); |
@@ -74,7 +74,7 @@ |
||
74 | 74 | * NOTE: If you want IMAGES, call extract( $blog_id, $post_id, ...) which will give you more/better image extraction |
75 | 75 | * This method will give you an error if you ask for IMAGES. |
76 | 76 | * |
77 | - * @param $content The HTML post_content of a post |
|
77 | + * @param string $content The HTML post_content of a post |
|
78 | 78 | * @param $what_to_extract (int) A mask of things to extract, e.g. Jetpack_Media_Meta_Extractor::IMAGES | Jetpack_Media_Meta_Extractor::MENTIONS |
79 | 79 | * @param $already_extracted (array) Previously extracted things, e.g. images from extract(), which can be used for x-referencing here |
80 | 80 | * @returns a structure containing metadata about the embedded things, or empty array if nothing found, or WP_Error on error |
@@ -214,6 +214,9 @@ discard block |
||
214 | 214 | } |
215 | 215 | } |
216 | 216 | |
217 | + /** |
|
218 | + * @param string $type |
|
219 | + */ |
|
217 | 220 | static function get_video_poster( $type, $id ) { |
218 | 221 | if ( 'videopress' == $type ) { |
219 | 222 | if ( function_exists( 'video_get_highest_resolution_image_url' ) ) { |
@@ -267,6 +270,9 @@ discard block |
||
267 | 270 | return str_word_count( self::clean_text( $post_content ) ); |
268 | 271 | } |
269 | 272 | |
273 | + /** |
|
274 | + * @param string $excerpt_content |
|
275 | + */ |
|
270 | 276 | static function get_word_remaining_count( $post_content, $excerpt_content ) { |
271 | 277 | return str_word_count( self::clean_text( $post_content ) ) - str_word_count( self::clean_text( $excerpt_content ) ); |
272 | 278 | } |
@@ -93,14 +93,24 @@ |
||
93 | 93 | * So that we can test. |
94 | 94 | */ |
95 | 95 | |
96 | + /** |
|
97 | + * @param string $class |
|
98 | + * @param string $method |
|
99 | + */ |
|
96 | 100 | public function method_exists( $class, $method ) { |
97 | 101 | return method_exists( $class, $method ); |
98 | 102 | } |
99 | 103 | |
104 | + /** |
|
105 | + * @param string $class |
|
106 | + */ |
|
100 | 107 | public function class_exists( $class ) { |
101 | 108 | return class_exists( $class ); |
102 | 109 | } |
103 | 110 | |
111 | + /** |
|
112 | + * @param string $function |
|
113 | + */ |
|
104 | 114 | public function function_exists( $function ) { |
105 | 115 | return function_exists( $function ); |
106 | 116 | } |
@@ -8,7 +8,7 @@ |
||
8 | 8 | * @param string $url_orig Original URL. |
9 | 9 | * @param array $url_info Pieces of original URL. |
10 | 10 | * |
11 | - * @return bool |
|
11 | + * @return false|string |
|
12 | 12 | */ |
13 | 13 | function jetpack_no_qtranslate_rest_url_redirect( $url_lang, $url_orig, $url_info ) { |
14 | 14 | if ( false !== strpos( $url_info['wp-path'], 'wp-json/jetpack' ) ) { |
@@ -598,7 +598,6 @@ discard block |
||
598 | 598 | * @uses Jetpack::disconnect(); |
599 | 599 | * @since 4.3.0 |
600 | 600 | * |
601 | - * @param WP_REST_Request $request The request sent to the WP REST API. |
|
602 | 601 | * |
603 | 602 | * @return string|WP_Error A raw URL if the connection URL could be built; error message otherwise. |
604 | 603 | */ |
@@ -618,7 +617,6 @@ discard block |
||
618 | 617 | * |
619 | 618 | * @since 4.3.0 |
620 | 619 | * |
621 | - * @param WP_REST_Request $request The request sent to the WP REST API. |
|
622 | 620 | * |
623 | 621 | * @return object |
624 | 622 | */ |
@@ -58,6 +58,10 @@ |
||
58 | 58 | return $query->is_main_query() && $query->is_search(); |
59 | 59 | } |
60 | 60 | |
61 | + /** |
|
62 | + * @param double $duration |
|
63 | + * @param boolean $was_jetpack_search |
|
64 | + */ |
|
61 | 65 | private function record_query_time( $duration, $was_jetpack_search ) { |
62 | 66 | $this->stats[] = array( $was_jetpack_search, intval( $duration * 1000 ) ); |
63 | 67 | } |
@@ -249,6 +249,9 @@ |
||
249 | 249 | } |
250 | 250 | } |
251 | 251 | |
252 | + /** |
|
253 | + * @param string $access_token |
|
254 | + */ |
|
252 | 255 | private static function verify_token( $access_token ) { |
253 | 256 | $request = array( |
254 | 257 | 'headers' => array( |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | /** |
87 | 87 | * Return an array of allowed mime_type items used to upload a media file. |
88 | 88 | * |
89 | - * @return array mime_type array |
|
89 | + * @return string[] mime_type array |
|
90 | 90 | */ |
91 | 91 | static function get_allowed_mime_types( $default_mime_types ) { |
92 | 92 | return array_unique( array_merge( $default_mime_types, array( |
@@ -253,7 +253,7 @@ discard block |
||
253 | 253 | * @param object $media_item - media post object |
254 | 254 | * @param file $file - file recently added |
255 | 255 | * @param bool $has_original_media - condition is the original media has been already added |
256 | - * @return bool `true` if the item has been added. Otherwise `false`. |
|
256 | + * @return false|null `true` if the item has been added. Otherwise `false`. |
|
257 | 257 | */ |
258 | 258 | public static function register_revision( $media_item, $file, $has_original_media ) { |
259 | 259 | if ( is_wp_error( $file ) || ! $has_original_media ) { |
@@ -281,6 +281,9 @@ discard block |
||
281 | 281 | return $original; |
282 | 282 | } |
283 | 283 | |
284 | + /** |
|
285 | + * @param string $pathname |
|
286 | + */ |
|
284 | 287 | public static function delete_file( $pathname ) { |
285 | 288 | if ( ! file_exists( $pathname ) || ! is_file( $pathname ) ) { |
286 | 289 | // let's touch a fake file to try to `really` remove the media file |
@@ -296,7 +299,7 @@ discard block |
||
296 | 299 | * |
297 | 300 | * @param number $media_id - media post ID |
298 | 301 | * @param string $filename - basename of the file ( name-of-file.ext ) |
299 | - * @return bool `true` is the file has been removed, `false` if not. |
|
302 | + * @return boolean|null `true` is the file has been removed, `false` if not. |
|
300 | 303 | */ |
301 | 304 | private static function delete_media_history_file( $media_id, $filename ) { |
302 | 305 | $attached_path = get_attached_file( $media_id ); |
@@ -366,6 +369,7 @@ discard block |
||
366 | 369 | * |
367 | 370 | * @param number $media_id - media post ID |
368 | 371 | * @param number [$limit] - maximun amount of items. 20 as default. |
372 | + * @param integer $limit |
|
369 | 373 | * @return array items removed from `revision_history` |
370 | 374 | */ |
371 | 375 | public static function limit_revision_history( $media_id, $limit = null) { |