@@ -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) { |
@@ -87,7 +87,7 @@ |
||
87 | 87 | * Construct object from image. |
88 | 88 | * |
89 | 89 | * @param optional $type (hex, rgb, hsv) |
90 | - * @return color as a string formatted as $type |
|
90 | + * @return false|string as a string formatted as $type |
|
91 | 91 | * |
92 | 92 | */ |
93 | 93 | function color( $type = 'hex' ) { |
@@ -100,6 +100,10 @@ discard block |
||
100 | 100 | ), menu_page_url( 'sharing', false ) ); |
101 | 101 | } |
102 | 102 | |
103 | + /** |
|
104 | + * @param string $service_name |
|
105 | + * @param string $for |
|
106 | + */ |
|
103 | 107 | static function refresh_url( $service_name, $for ) { |
104 | 108 | return add_query_arg( array( |
105 | 109 | 'action' => 'request', |
@@ -111,6 +115,10 @@ discard block |
||
111 | 115 | ), admin_url( 'options-general.php?page=sharing' ) ); |
112 | 116 | } |
113 | 117 | |
118 | + /** |
|
119 | + * @param string $service_name |
|
120 | + * @param string $id |
|
121 | + */ |
|
114 | 122 | static function disconnect_url( $service_name, $id ) { |
115 | 123 | return add_query_arg( array( |
116 | 124 | 'action' => 'delete', |
@@ -33,6 +33,9 @@ discard block |
||
33 | 33 | public $extra_headers = array(); |
34 | 34 | |
35 | 35 | /** |
36 | + * @param string $method |
|
37 | + * @param string $url |
|
38 | + * @param string $post_body |
|
36 | 39 | * @return WPCOM_JSON_API instance |
37 | 40 | */ |
38 | 41 | static function init( $method = null, $url = null, $post_body = null ) { |
@@ -335,6 +338,9 @@ discard block |
||
335 | 338 | return call_user_func_array( array( $endpoint, 'callback' ), $path_pieces ); |
336 | 339 | } |
337 | 340 | |
341 | + /** |
|
342 | + * @param integer $status_code |
|
343 | + */ |
|
338 | 344 | function output_early( $status_code, $response = null, $content_type = 'application/json' ) { |
339 | 345 | $exit = $this->exit; |
340 | 346 | $this->exit = false; |
@@ -543,11 +549,18 @@ discard block |
||
543 | 549 | return json_encode( $data ); |
544 | 550 | } |
545 | 551 | |
552 | + /** |
|
553 | + * @param string $needle |
|
554 | + */ |
|
546 | 555 | function ends_with( $haystack, $needle ) { |
547 | 556 | return $needle === substr( $haystack, -strlen( $needle ) ); |
548 | 557 | } |
549 | 558 | |
550 | 559 | // Returns the site's blog_id in the WP.com ecosystem |
560 | + |
|
561 | + /** |
|
562 | + * @return integer |
|
563 | + */ |
|
551 | 564 | function get_blog_id_for_output() { |
552 | 565 | return $this->token_details['blog_id']; |
553 | 566 | } |
@@ -570,6 +583,10 @@ discard block |
||
570 | 583 | } |
571 | 584 | |
572 | 585 | // Returns true if the specified blog ID is a restricted blog |
586 | + |
|
587 | + /** |
|
588 | + * @param integer $blog_id |
|
589 | + */ |
|
573 | 590 | function is_restricted_blog( $blog_id ) { |
574 | 591 | /** |
575 | 592 | * Filters all REST API access and return a 403 unauthorized response for all Restricted blog IDs. |
@@ -619,7 +636,7 @@ discard block |
||
619 | 636 | /** |
620 | 637 | * Counts the number of comments on a site, excluding certain comment types. |
621 | 638 | * |
622 | - * @param $post_id int Post ID. |
|
639 | + * @param integer $post_id int Post ID. |
|
623 | 640 | * @return array Array of counts, matching the output of https://developer.wordpress.org/reference/functions/get_comment_count/. |
624 | 641 | */ |
625 | 642 | public function wp_count_comments( $post_id ) { |
@@ -213,7 +213,6 @@ discard block |
||
213 | 213 | /** |
214 | 214 | * Inject image sizes to Jetpack REST API responses. This wraps the filter_photon_norezise_maybe_inject_sizes function. |
215 | 215 | * |
216 | - * @param array $data Attachment sizes data. |
|
217 | 216 | * @param int $attachment_id Attachment's post ID. |
218 | 217 | * |
219 | 218 | * @return array Attachment sizes array. |
@@ -1257,7 +1256,7 @@ discard block |
||
1257 | 1256 | * after ourselves without breaking anyone else's filters. |
1258 | 1257 | * |
1259 | 1258 | * @internal |
1260 | - * @return true |
|
1259 | + * @return boolean |
|
1261 | 1260 | */ |
1262 | 1261 | public function _override_image_downsize_in_rest_edit_context() { |
1263 | 1262 | return true; |
@@ -52,7 +52,7 @@ |
||
52 | 52 | /** |
53 | 53 | * Helper function to look up the expected master user and return the local WP_User. |
54 | 54 | * |
55 | - * @return WP_User Jetpack's expected master user. |
|
55 | + * @return string Jetpack's expected master user. |
|
56 | 56 | */ |
57 | 57 | protected function helper_retrieve_local_master_user() { |
58 | 58 | $master_user = Jetpack_Options::get_option( 'master_user' ); |
@@ -162,6 +162,7 @@ discard block |
||
162 | 162 | /** |
163 | 163 | * Get attachment images for a specified post and return them. Also make sure |
164 | 164 | * their dimensions are at or above a required minimum. |
165 | + * @param integer $post_id |
|
165 | 166 | */ |
166 | 167 | static function from_attachment( $post_id, $width = 200, $height = 200 ) { |
167 | 168 | $images = array(); |
@@ -224,7 +225,7 @@ discard block |
||
224 | 225 | * Check if a Featured Image is set for this post, and return it in a similar |
225 | 226 | * format to the other images?_from_*() methods. |
226 | 227 | * @param int $post_id The post ID to check |
227 | - * @return Array containing details of the Featured Image, or empty array if none. |
|
228 | + * @return integer|null containing details of the Featured Image, or empty array if none. |
|
228 | 229 | */ |
229 | 230 | static function from_thumbnail( $post_id, $width = 200, $height = 200 ) { |
230 | 231 | $images = array(); |
@@ -668,7 +669,6 @@ discard block |
||
668 | 669 | * resized and cropped image. |
669 | 670 | * |
670 | 671 | * @param string $src |
671 | - * @param int $dimension |
|
672 | 672 | * @return string Transformed image URL |
673 | 673 | */ |
674 | 674 | static function fit_image_url( $src, $width, $height ) { |
@@ -715,7 +715,7 @@ discard block |
||
715 | 715 | * |
716 | 716 | * @param mixed $html_or_id The HTML string to parse for images, or a post id. |
717 | 717 | * |
718 | - * @return array $html_info { |
|
718 | + * @return integer $html_info { |
|
719 | 719 | * @type string $html Post content. |
720 | 720 | * @type string $post_url Post URL. |
721 | 721 | * } |
@@ -410,7 +410,7 @@ |
||
410 | 410 | * |
411 | 411 | * @param Mixed $needle the needle. |
412 | 412 | * @param Array $haystack the haystack. |
413 | - * @return is the needle not in the haystack? |
|
413 | + * @return boolean the needle not in the haystack? |
|
414 | 414 | */ |
415 | 415 | protected function negative_in_array( $needle, $haystack ) { |
416 | 416 | if ( in_array( $needle, $haystack, true ) ) { |
@@ -271,6 +271,9 @@ discard block |
||
271 | 271 | } |
272 | 272 | } |
273 | 273 | |
274 | + /** |
|
275 | + * @param string $type |
|
276 | + */ |
|
274 | 277 | static function get_video_poster( $type, $id ) { |
275 | 278 | if ( 'videopress' == $type ) { |
276 | 279 | if ( function_exists( 'video_get_highest_resolution_image_url' ) ) { |
@@ -356,6 +359,9 @@ discard block |
||
356 | 359 | return (int) count( self::split_content_in_words( self::clean_text( $post_content ) ) ); |
357 | 360 | } |
358 | 361 | |
362 | + /** |
|
363 | + * @param string $excerpt_content |
|
364 | + */ |
|
359 | 365 | static function get_word_remaining_count( $post_content, $excerpt_content ) { |
360 | 366 | $content_word_count = count( self::split_content_in_words( self::clean_text( $post_content ) ) ); |
361 | 367 | $excerpt_word_count = count( self::split_content_in_words( self::clean_text( $excerpt_content ) ) ); |