@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | * |
70 | 70 | * @since 5.9 |
71 | 71 | * |
72 | - * @return string Length of the multibyte string |
|
72 | + * @return integer Length of the multibyte string |
|
73 | 73 | * |
74 | 74 | */ |
75 | 75 | function jetpack_utf8_strlen( $text ) { |
@@ -169,6 +169,9 @@ discard block |
||
169 | 169 | } |
170 | 170 | |
171 | 171 | |
172 | + /** |
|
173 | + * @param string $text |
|
174 | + */ |
|
172 | 175 | function transform($text) { |
173 | 176 | # |
174 | 177 | # Main function. Performs some preprocessing on the input text |
@@ -903,6 +906,10 @@ discard block |
||
903 | 906 | |
904 | 907 | public $list_level = 0; |
905 | 908 | |
909 | + /** |
|
910 | + * @param string $list_str |
|
911 | + * @param string $marker_any_re |
|
912 | + */ |
|
906 | 913 | function processListItems($list_str, $marker_any_re) { |
907 | 914 | # |
908 | 915 | # Process the contents of a single ordered or unordered list, splitting it |
@@ -1006,6 +1013,9 @@ discard block |
||
1006 | 1013 | } |
1007 | 1014 | |
1008 | 1015 | |
1016 | + /** |
|
1017 | + * @param string $code |
|
1018 | + */ |
|
1009 | 1019 | function makeCodeSpan($code) { |
1010 | 1020 | # |
1011 | 1021 | # Create a code span markup for $code. Called from handleSpanToken. |
@@ -1498,6 +1508,9 @@ discard block |
||
1498 | 1508 | # hanlde UTF-8 if the default function does not exist. |
1499 | 1509 | public $utf8_strlen = 'mb_strlen'; |
1500 | 1510 | |
1511 | + /** |
|
1512 | + * @param string $text |
|
1513 | + */ |
|
1501 | 1514 | function detab($text) { |
1502 | 1515 | # |
1503 | 1516 | # Replace tabs with the appropriate amount of space. |
@@ -2042,6 +2055,12 @@ discard block |
||
2042 | 2055 | |
2043 | 2056 | return array($parsed, $text); |
2044 | 2057 | } |
2058 | + |
|
2059 | + /** |
|
2060 | + * @param string $text |
|
2061 | + * @param string $hash_method |
|
2062 | + * @param boolean $md_attr |
|
2063 | + */ |
|
2045 | 2064 | function _hashHTMLBlocks_inHTML($text, $hash_method, $md_attr) { |
2046 | 2065 | # |
2047 | 2066 | # Parse HTML, calling _HashHTMLBlocks_InMarkdown for block tags. |
@@ -2706,6 +2725,9 @@ discard block |
||
2706 | 2725 | } |
2707 | 2726 | |
2708 | 2727 | |
2728 | + /** |
|
2729 | + * @return string |
|
2730 | + */ |
|
2709 | 2731 | function processDefListItems($list_str) { |
2710 | 2732 | # |
2711 | 2733 | # Process the contents of a single definition list, splitting it |
@@ -2817,6 +2839,10 @@ discard block |
||
2817 | 2839 | |
2818 | 2840 | return $text; |
2819 | 2841 | } |
2842 | + |
|
2843 | + /** |
|
2844 | + * @param string[] $matches |
|
2845 | + */ |
|
2820 | 2846 | function _doFencedCodeBlocks_callback($matches) { |
2821 | 2847 | $classname =& $matches[2]; |
2822 | 2848 | $attrs =& $matches[3]; |
@@ -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) { |
@@ -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', |
@@ -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' ); |
@@ -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 ) ) ); |
@@ -199,7 +199,7 @@ |
||
199 | 199 | * @param string $type Test type, async or direct. Optional, direct all tests. |
200 | 200 | * @param string $group Testing group to check status of. Optional, default all tests. |
201 | 201 | * |
202 | - * @return true|array True if all tests pass. Array of failed tests. |
|
202 | + * @return boolean True if all tests pass. Array of failed tests. |
|
203 | 203 | */ |
204 | 204 | public function pass( $type = 'all', $group = 'all' ) { |
205 | 205 | $results = $this->raw_results( $type, $group ); |