@@ -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' ) { |
@@ -9,6 +9,11 @@ discard block |
||
9 | 9 | public $link; |
10 | 10 | public $grayscale; |
11 | 11 | public $columns; |
12 | + |
|
13 | + /** |
|
14 | + * @param boolean $grayscale |
|
15 | + * @param integer $columns |
|
16 | + */ |
|
12 | 17 | public function __construct( $attachments, $link, $grayscale, $columns ) { |
13 | 18 | |
14 | 19 | $this->attachments = $attachments; |
@@ -39,6 +44,9 @@ discard block |
||
39 | 44 | return $html; |
40 | 45 | } |
41 | 46 | |
47 | + /** |
|
48 | + * @param string $name |
|
49 | + */ |
|
42 | 50 | private function template( $name, $context = null ) { |
43 | 51 | if ( ! in_array( $name, self::$templates ) ) { |
44 | 52 | return; |
@@ -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; |
@@ -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 | * } |
@@ -416,7 +416,7 @@ |
||
416 | 416 | * Only enqueue block assets when needed. |
417 | 417 | * |
418 | 418 | * @param string $type Slug of the block. |
419 | - * @param array $script_dependencies Script dependencies. Will be merged with automatically |
|
419 | + * @param string[] $script_dependencies Script dependencies. Will be merged with automatically |
|
420 | 420 | * detected script dependencies from the webpack build. |
421 | 421 | * |
422 | 422 | * @return void |
@@ -716,7 +716,7 @@ discard block |
||
716 | 716 | * This is ported over from the manage module, which has been deprecated and baked in here. |
717 | 717 | * |
718 | 718 | * @param $domains |
719 | - * @return array |
|
719 | + * @return string[] |
|
720 | 720 | */ |
721 | 721 | function allow_wpcom_domain( $domains ) { |
722 | 722 | if ( empty( $domains ) ) { |
@@ -1236,7 +1236,7 @@ discard block |
||
1236 | 1236 | } |
1237 | 1237 | /** |
1238 | 1238 | * Does the network allow admins to add new users. |
1239 | - * @return boolian |
|
1239 | + * @return boolean |
|
1240 | 1240 | */ |
1241 | 1241 | static function network_add_new_users( $option = null ) { |
1242 | 1242 | return (bool) get_site_option( 'add_new_users' ); |
@@ -1341,7 +1341,7 @@ discard block |
||
1341 | 1341 | * database which could be set to anything as opposed to what this function returns. |
1342 | 1342 | * @param bool $option |
1343 | 1343 | * |
1344 | - * @return boolean |
|
1344 | + * @return string |
|
1345 | 1345 | */ |
1346 | 1346 | public function is_main_network_option( $option ) { |
1347 | 1347 | // return '1' or '' |
@@ -1352,7 +1352,7 @@ discard block |
||
1352 | 1352 | * Return true if we are with multi-site or multi-network false if we are dealing with single site. |
1353 | 1353 | * |
1354 | 1354 | * @param string $option |
1355 | - * @return boolean |
|
1355 | + * @return string |
|
1356 | 1356 | */ |
1357 | 1357 | public function is_multisite( $option ) { |
1358 | 1358 | return (string) (bool) is_multisite(); |
@@ -1414,7 +1414,7 @@ discard block |
||
1414 | 1414 | |
1415 | 1415 | /** |
1416 | 1416 | * Returns true if the site has file write access false otherwise. |
1417 | - * @return string ( '1' | '0' ) |
|
1417 | + * @return integer ( '1' | '0' ) |
|
1418 | 1418 | **/ |
1419 | 1419 | public static function file_system_write_access() { |
1420 | 1420 | if ( ! function_exists( 'get_filesystem_method' ) ) { |
@@ -2145,6 +2145,7 @@ discard block |
||
2145 | 2145 | * @param int $user_id |
2146 | 2146 | * @param string $token |
2147 | 2147 | * return bool |
2148 | + * @param boolean $is_master_user |
|
2148 | 2149 | */ |
2149 | 2150 | public static function update_user_token( $user_id, $token, $is_master_user ) { |
2150 | 2151 | // not designed for concurrent updates |
@@ -2547,6 +2548,7 @@ discard block |
||
2547 | 2548 | |
2548 | 2549 | /** |
2549 | 2550 | * Like core's get_file_data implementation, but caches the result. |
2551 | + * @param string $file |
|
2550 | 2552 | */ |
2551 | 2553 | public static function get_file_data( $file, $headers ) { |
2552 | 2554 | //Get just the filename from $file (i.e. exclude full path) so that a consistent hash is generated |
@@ -2583,7 +2585,7 @@ discard block |
||
2583 | 2585 | * |
2584 | 2586 | * @param string $tag Tag as it appears in each module heading. |
2585 | 2587 | * |
2586 | - * @return mixed |
|
2588 | + * @return string |
|
2587 | 2589 | */ |
2588 | 2590 | public static function translate_module_tag( $tag ) { |
2589 | 2591 | return jetpack_get_module_i18n_tag( $tag ); |
@@ -2755,8 +2757,8 @@ discard block |
||
2755 | 2757 | * Rewrites ABSPATH (eg `/home/jetpack/wordpress/`) to ABSPATH, and if WP_CONTENT_DIR |
2756 | 2758 | * is located outside of ABSPATH, rewrites that to WP_CONTENT_DIR. |
2757 | 2759 | * |
2758 | - * @param $string |
|
2759 | - * @return mixed |
|
2760 | + * @param string $string |
|
2761 | + * @return string|null |
|
2760 | 2762 | */ |
2761 | 2763 | public static function alias_directories( $string ) { |
2762 | 2764 | // ABSPATH has a trailing slash. |
@@ -3036,6 +3038,9 @@ discard block |
||
3036 | 3038 | return self::update_active_modules( $new ); |
3037 | 3039 | } |
3038 | 3040 | |
3041 | + /** |
|
3042 | + * @param string $module |
|
3043 | + */ |
|
3039 | 3044 | public static function enable_module_configurable( $module ) { |
3040 | 3045 | $module = Jetpack::get_module_slug( $module ); |
3041 | 3046 | add_filter( 'jetpack_module_configurable_' . $module, '__return_true' ); |
@@ -3064,6 +3069,9 @@ discard block |
||
3064 | 3069 | } |
3065 | 3070 | |
3066 | 3071 | /* Installation */ |
3072 | + /** |
|
3073 | + * @param string $message |
|
3074 | + */ |
|
3067 | 3075 | public static function bail_on_activation( $message, $deactivate = true ) { |
3068 | 3076 | ?> |
3069 | 3077 | <!doctype html> |
@@ -3798,7 +3806,7 @@ discard block |
||
3798 | 3806 | * Add help to the Jetpack page |
3799 | 3807 | * |
3800 | 3808 | * @since Jetpack (1.2.3) |
3801 | - * @return false if not the Jetpack page |
|
3809 | + * @return false|null if not the Jetpack page |
|
3802 | 3810 | */ |
3803 | 3811 | function admin_help() { |
3804 | 3812 | $current_screen = get_current_screen(); |
@@ -4617,6 +4625,9 @@ discard block |
||
4617 | 4625 | return $url; |
4618 | 4626 | } |
4619 | 4627 | |
4628 | + /** |
|
4629 | + * @return string |
|
4630 | + */ |
|
4620 | 4631 | public static function nonce_url_no_esc( $actionurl, $action = -1, $name = '_wpnonce' ) { |
4621 | 4632 | $actionurl = str_replace( '&', '&', $actionurl ); |
4622 | 4633 | return add_query_arg( $name, wp_create_nonce( $action ), $actionurl ); |
@@ -4676,6 +4687,7 @@ discard block |
||
4676 | 4687 | /** |
4677 | 4688 | * Returns the requested Jetpack API URL |
4678 | 4689 | * |
4690 | + * @param string $relative_url |
|
4679 | 4691 | * @return string |
4680 | 4692 | */ |
4681 | 4693 | public static function api_url( $relative_url ) { |
@@ -4867,6 +4879,7 @@ discard block |
||
4867 | 4879 | * Note these tokens are unique per call, NOT static per site for connecting. |
4868 | 4880 | * |
4869 | 4881 | * @since 2.6 |
4882 | + * @param string $action |
|
4870 | 4883 | * @return array |
4871 | 4884 | */ |
4872 | 4885 | public static function generate_secrets( $action, $user_id = false, $exp = 600 ) { |
@@ -5401,7 +5414,6 @@ discard block |
||
5401 | 5414 | /** |
5402 | 5415 | * Report authentication status to the WP REST API. |
5403 | 5416 | * |
5404 | - * @param WP_Error|mixed $result Error from another authentication handler, null if we should handle it, or another value if not |
|
5405 | 5417 | * @return WP_Error|boolean|null {@see WP_JSON_Server::check_authentication} |
5406 | 5418 | */ |
5407 | 5419 | public function wp_rest_authentication_errors( $value ) { |
@@ -5411,6 +5423,10 @@ discard block |
||
5411 | 5423 | return $this->rest_authentication_status; |
5412 | 5424 | } |
5413 | 5425 | |
5426 | + /** |
|
5427 | + * @param integer $timestamp |
|
5428 | + * @param string $nonce |
|
5429 | + */ |
|
5414 | 5430 | function add_nonce( $timestamp, $nonce ) { |
5415 | 5431 | global $wpdb; |
5416 | 5432 | static $nonces_used_this_request = array(); |
@@ -5556,6 +5572,7 @@ discard block |
||
5556 | 5572 | * @param string $key |
5557 | 5573 | * @param string $value |
5558 | 5574 | * @param bool $restate private |
5575 | + * @return string |
|
5559 | 5576 | */ |
5560 | 5577 | public static function state( $key = null, $value = null, $restate = false ) { |
5561 | 5578 | static $state = array(); |
@@ -5612,6 +5629,9 @@ discard block |
||
5612 | 5629 | Jetpack::state( null, null, true ); |
5613 | 5630 | } |
5614 | 5631 | |
5632 | + /** |
|
5633 | + * @param string $file |
|
5634 | + */ |
|
5615 | 5635 | public static function check_privacy( $file ) { |
5616 | 5636 | static $is_site_publicly_accessible = null; |
5617 | 5637 | |
@@ -5694,6 +5714,9 @@ discard block |
||
5694 | 5714 | } |
5695 | 5715 | } |
5696 | 5716 | |
5717 | + /** |
|
5718 | + * @param string $url |
|
5719 | + */ |
|
5697 | 5720 | public static function staticize_subdomain( $url ) { |
5698 | 5721 | |
5699 | 5722 | // Extract hostname from URL |
@@ -6244,9 +6267,7 @@ discard block |
||
6244 | 6267 | * |
6245 | 6268 | * Attached to `style_loader_src` filter. |
6246 | 6269 | * |
6247 | - * @param string $tag The tag that would link to the external asset. |
|
6248 | 6270 | * @param string $handle The registered handle of the script in question. |
6249 | - * @param string $href The url of the asset in question. |
|
6250 | 6271 | */ |
6251 | 6272 | public static function set_suffix_on_min( $src, $handle ) { |
6252 | 6273 | if ( false === strpos( $src, '.min.css' ) ) { |
@@ -6429,8 +6450,8 @@ discard block |
||
6429 | 6450 | * - Absolute URLs `http://domain.com/feh.png` |
6430 | 6451 | * - Domain root relative URLs `/feh.png` |
6431 | 6452 | * |
6432 | - * @param $css string: The raw CSS -- should be read in directly from the file. |
|
6433 | - * @param $css_file_url : The URL that the file can be accessed at, for calculating paths from. |
|
6453 | + * @param string $css string: The raw CSS -- should be read in directly from the file. |
|
6454 | + * @param string $css_file_url : The URL that the file can be accessed at, for calculating paths from. |
|
6434 | 6455 | * |
6435 | 6456 | * @return mixed|string |
6436 | 6457 | */ |
@@ -6673,7 +6694,7 @@ discard block |
||
6673 | 6694 | /** |
6674 | 6695 | * Stores and prints out domains to prefetch for page speed optimization. |
6675 | 6696 | * |
6676 | - * @param mixed $new_urls |
|
6697 | + * @param string[] $new_urls |
|
6677 | 6698 | */ |
6678 | 6699 | public static function dns_prefetch( $new_urls = null ) { |
6679 | 6700 | static $prefetch_urls = array(); |
@@ -6728,7 +6749,6 @@ discard block |
||
6728 | 6749 | } |
6729 | 6750 | |
6730 | 6751 | /** |
6731 | - * @param mixed $result Value for the user's option |
|
6732 | 6752 | * @return mixed |
6733 | 6753 | */ |
6734 | 6754 | function get_user_option_meta_box_order_dashboard( $sorted ) { |