@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | * |
| 46 | 46 | * @param array $allowed_post_types Allowed post types. |
| 47 | 47 | * |
| 48 | - * @return array |
|
| 48 | + * @return string[] |
|
| 49 | 49 | */ |
| 50 | 50 | public function allow_bbpress_post_types( $allowed_post_types ) { |
| 51 | 51 | $allowed_post_types[] = 'forum'; |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | * |
| 60 | 60 | * @param array $allowed_meta_keys Allowed meta keys. |
| 61 | 61 | * |
| 62 | - * @return array |
|
| 62 | + * @return string[] |
|
| 63 | 63 | */ |
| 64 | 64 | public function allow_bbpress_public_metadata( $allowed_meta_keys ) { |
| 65 | 65 | $allowed_meta_keys[] = '_bbp_forum_id'; |
@@ -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 ) ) { |
@@ -166,6 +166,7 @@ discard block |
||
| 166 | 166 | /** |
| 167 | 167 | * Get attachment images for a specified post and return them. Also make sure |
| 168 | 168 | * their dimensions are at or above a required minimum. |
| 169 | + * @param integer $post_id |
|
| 169 | 170 | */ |
| 170 | 171 | static function from_attachment( $post_id, $width = 200, $height = 200 ) { |
| 171 | 172 | $images = array(); |
@@ -232,7 +233,7 @@ discard block |
||
| 232 | 233 | * format to the other images?_from_*() methods. |
| 233 | 234 | * |
| 234 | 235 | * @param int $post_id The post ID to check |
| 235 | - * @return array containing details of the Featured Image, or empty array if none. |
|
| 236 | + * @return integer|null containing details of the Featured Image, or empty array if none. |
|
| 236 | 237 | */ |
| 237 | 238 | static function from_thumbnail( $post_id, $width = 200, $height = 200 ) { |
| 238 | 239 | $images = array(); |
@@ -687,7 +688,6 @@ discard block |
||
| 687 | 688 | * resized and cropped image. |
| 688 | 689 | * |
| 689 | 690 | * @param string $src |
| 690 | - * @param int $dimension |
|
| 691 | 691 | * @return string Transformed image URL |
| 692 | 692 | */ |
| 693 | 693 | static function fit_image_url( $src, $width, $height ) { |
@@ -904,7 +904,7 @@ discard block |
||
| 904 | 904 | * This is ported over from the manage module, which has been deprecated and baked in here. |
| 905 | 905 | * |
| 906 | 906 | * @param $domains |
| 907 | - * @return array |
|
| 907 | + * @return string[] |
|
| 908 | 908 | */ |
| 909 | 909 | function allow_wpcom_domain( $domains ) { |
| 910 | 910 | if ( empty( $domains ) ) { |
@@ -1330,7 +1330,7 @@ discard block |
||
| 1330 | 1330 | /** |
| 1331 | 1331 | * Does the network allow admins to add new users. |
| 1332 | 1332 | * |
| 1333 | - * @return boolian |
|
| 1333 | + * @return boolean |
|
| 1334 | 1334 | */ |
| 1335 | 1335 | static function network_add_new_users( $option = null ) { |
| 1336 | 1336 | return (bool) get_site_option( 'add_new_users' ); |
@@ -1440,7 +1440,7 @@ discard block |
||
| 1440 | 1440 | * |
| 1441 | 1441 | * @param bool $option |
| 1442 | 1442 | * |
| 1443 | - * @return boolean |
|
| 1443 | + * @return string |
|
| 1444 | 1444 | */ |
| 1445 | 1445 | public function is_main_network_option( $option ) { |
| 1446 | 1446 | // return '1' or '' |
@@ -1451,7 +1451,7 @@ discard block |
||
| 1451 | 1451 | * Return true if we are with multi-site or multi-network false if we are dealing with single site. |
| 1452 | 1452 | * |
| 1453 | 1453 | * @param string $option |
| 1454 | - * @return boolean |
|
| 1454 | + * @return string |
|
| 1455 | 1455 | */ |
| 1456 | 1456 | public function is_multisite( $option ) { |
| 1457 | 1457 | return (string) (bool) is_multisite(); |
@@ -1514,7 +1514,7 @@ discard block |
||
| 1514 | 1514 | /** |
| 1515 | 1515 | * Returns true if the site has file write access false otherwise. |
| 1516 | 1516 | * |
| 1517 | - * @return string ( '1' | '0' ) |
|
| 1517 | + * @return integer ( '1' | '0' ) |
|
| 1518 | 1518 | **/ |
| 1519 | 1519 | public static function file_system_write_access() { |
| 1520 | 1520 | if ( ! function_exists( 'get_filesystem_method' ) ) { |
@@ -2676,7 +2676,7 @@ discard block |
||
| 2676 | 2676 | * |
| 2677 | 2677 | * @param string $tag Tag as it appears in each module heading. |
| 2678 | 2678 | * |
| 2679 | - * @return mixed |
|
| 2679 | + * @return string |
|
| 2680 | 2680 | */ |
| 2681 | 2681 | public static function translate_module_tag( $tag ) { |
| 2682 | 2682 | return jetpack_get_module_i18n_tag( $tag ); |
@@ -2848,8 +2848,8 @@ discard block |
||
| 2848 | 2848 | * Rewrites ABSPATH (eg `/home/jetpack/wordpress/`) to ABSPATH, and if WP_CONTENT_DIR |
| 2849 | 2849 | * is located outside of ABSPATH, rewrites that to WP_CONTENT_DIR. |
| 2850 | 2850 | * |
| 2851 | - * @param $string |
|
| 2852 | - * @return mixed |
|
| 2851 | + * @param string $string |
|
| 2852 | + * @return string|null |
|
| 2853 | 2853 | */ |
| 2854 | 2854 | public static function alias_directories( $string ) { |
| 2855 | 2855 | // ABSPATH has a trailing slash. |
@@ -2860,6 +2860,10 @@ discard block |
||
| 2860 | 2860 | return $string; |
| 2861 | 2861 | } |
| 2862 | 2862 | |
| 2863 | + /** |
|
| 2864 | + * @param boolean $redirect |
|
| 2865 | + * @param boolean $send_state_messages |
|
| 2866 | + */ |
|
| 2863 | 2867 | public static function activate_default_modules( |
| 2864 | 2868 | $min_version = false, |
| 2865 | 2869 | $max_version = false, |
@@ -3125,6 +3129,9 @@ discard block |
||
| 3125 | 3129 | _deprecated_function( __METHOD__, 'jetpack-4.2' ); |
| 3126 | 3130 | } |
| 3127 | 3131 | |
| 3132 | + /** |
|
| 3133 | + * @return string |
|
| 3134 | + */ |
|
| 3128 | 3135 | public static function deactivate_module( $module ) { |
| 3129 | 3136 | /** |
| 3130 | 3137 | * Fires when a module is deactivated. |
@@ -3143,6 +3150,9 @@ discard block |
||
| 3143 | 3150 | return self::update_active_modules( $new ); |
| 3144 | 3151 | } |
| 3145 | 3152 | |
| 3153 | + /** |
|
| 3154 | + * @param string $module |
|
| 3155 | + */ |
|
| 3146 | 3156 | public static function enable_module_configurable( $module ) { |
| 3147 | 3157 | $module = self::get_module_slug( $module ); |
| 3148 | 3158 | add_filter( 'jetpack_module_configurable_' . $module, '__return_true' ); |
@@ -3171,6 +3181,10 @@ discard block |
||
| 3171 | 3181 | } |
| 3172 | 3182 | |
| 3173 | 3183 | /* Installation */ |
| 3184 | + |
|
| 3185 | + /** |
|
| 3186 | + * @param string $message |
|
| 3187 | + */ |
|
| 3174 | 3188 | public static function bail_on_activation( $message, $deactivate = true ) { |
| 3175 | 3189 | ?> |
| 3176 | 3190 | <!doctype html> |
@@ -3926,7 +3940,7 @@ discard block |
||
| 3926 | 3940 | * Add help to the Jetpack page |
| 3927 | 3941 | * |
| 3928 | 3942 | * @since Jetpack (1.2.3) |
| 3929 | - * @return false if not the Jetpack page |
|
| 3943 | + * @return false|null if not the Jetpack page |
|
| 3930 | 3944 | */ |
| 3931 | 3945 | function admin_help() { |
| 3932 | 3946 | $current_screen = get_current_screen(); |
@@ -5266,7 +5280,7 @@ discard block |
||
| 5266 | 5280 | * @param String $action The action name. |
| 5267 | 5281 | * @param Integer $user_id The user identifier. |
| 5268 | 5282 | * @param Integer $exp Expiration time in seconds. |
| 5269 | - * @return array |
|
| 5283 | + * @return boolean |
|
| 5270 | 5284 | */ |
| 5271 | 5285 | public static function generate_secrets( $action, $user_id = false, $exp = 600 ) { |
| 5272 | 5286 | return self::connection()->generate_secrets( $action, $user_id, $exp ); |
@@ -5586,7 +5600,6 @@ discard block |
||
| 5586 | 5600 | /** |
| 5587 | 5601 | * Report authentication status to the WP REST API. |
| 5588 | 5602 | * |
| 5589 | - * @param WP_Error|mixed $result Error from another authentication handler, null if we should handle it, or another value if not |
|
| 5590 | 5603 | * @return WP_Error|boolean|null {@see WP_JSON_Server::check_authentication} |
| 5591 | 5604 | */ |
| 5592 | 5605 | public function wp_rest_authentication_errors( $value ) { |
@@ -5713,6 +5726,7 @@ discard block |
||
| 5713 | 5726 | * @param string $key |
| 5714 | 5727 | * @param string $value |
| 5715 | 5728 | * @param bool $restate private |
| 5729 | + * @return string |
|
| 5716 | 5730 | */ |
| 5717 | 5731 | public static function state( $key = null, $value = null, $restate = false ) { |
| 5718 | 5732 | static $state = array(); |
@@ -5773,6 +5787,9 @@ discard block |
||
| 5773 | 5787 | self::state( null, null, true ); |
| 5774 | 5788 | } |
| 5775 | 5789 | |
| 5790 | + /** |
|
| 5791 | + * @param string $file |
|
| 5792 | + */ |
|
| 5776 | 5793 | public static function check_privacy( $file ) { |
| 5777 | 5794 | static $is_site_publicly_accessible = null; |
| 5778 | 5795 | |
@@ -5853,6 +5870,9 @@ discard block |
||
| 5853 | 5870 | } |
| 5854 | 5871 | } |
| 5855 | 5872 | |
| 5873 | + /** |
|
| 5874 | + * @param string $url |
|
| 5875 | + */ |
|
| 5856 | 5876 | public static function staticize_subdomain( $url ) { |
| 5857 | 5877 | |
| 5858 | 5878 | // Extract hostname from URL |
@@ -6370,9 +6390,7 @@ discard block |
||
| 6370 | 6390 | * |
| 6371 | 6391 | * Attached to `style_loader_src` filter. |
| 6372 | 6392 | * |
| 6373 | - * @param string $tag The tag that would link to the external asset. |
|
| 6374 | 6393 | * @param string $handle The registered handle of the script in question. |
| 6375 | - * @param string $href The url of the asset in question. |
|
| 6376 | 6394 | */ |
| 6377 | 6395 | public static function set_suffix_on_min( $src, $handle ) { |
| 6378 | 6396 | if ( false === strpos( $src, '.min.css' ) ) { |
@@ -6579,8 +6597,8 @@ discard block |
||
| 6579 | 6597 | * - Absolute URLs `http://domain.com/feh.png` |
| 6580 | 6598 | * - Domain root relative URLs `/feh.png` |
| 6581 | 6599 | * |
| 6582 | - * @param $css string: The raw CSS -- should be read in directly from the file. |
|
| 6583 | - * @param $css_file_url : The URL that the file can be accessed at, for calculating paths from. |
|
| 6600 | + * @param string $css string: The raw CSS -- should be read in directly from the file. |
|
| 6601 | + * @param string $css_file_url : The URL that the file can be accessed at, for calculating paths from. |
|
| 6584 | 6602 | * |
| 6585 | 6603 | * @return mixed|string |
| 6586 | 6604 | */ |
@@ -6841,7 +6859,7 @@ discard block |
||
| 6841 | 6859 | /** |
| 6842 | 6860 | * Stores and prints out domains to prefetch for page speed optimization. |
| 6843 | 6861 | * |
| 6844 | - * @param mixed $new_urls |
|
| 6862 | + * @param string[] $new_urls |
|
| 6845 | 6863 | */ |
| 6846 | 6864 | public static function dns_prefetch( $new_urls = null ) { |
| 6847 | 6865 | static $prefetch_urls = array(); |
@@ -6898,7 +6916,6 @@ discard block |
||
| 6898 | 6916 | } |
| 6899 | 6917 | |
| 6900 | 6918 | /** |
| 6901 | - * @param mixed $result Value for the user's option |
|
| 6902 | 6919 | * @return mixed |
| 6903 | 6920 | */ |
| 6904 | 6921 | function get_user_option_meta_box_order_dashboard( $sorted ) { |
@@ -348,6 +348,9 @@ discard block |
||
| 348 | 348 | return call_user_func_array( array( $endpoint, 'callback' ), $path_pieces ); |
| 349 | 349 | } |
| 350 | 350 | |
| 351 | + /** |
|
| 352 | + * @param integer $status_code |
|
| 353 | + */ |
|
| 351 | 354 | function output_early( $status_code, $response = null, $content_type = 'application/json' ) { |
| 352 | 355 | $exit = $this->exit; |
| 353 | 356 | $this->exit = false; |
@@ -571,11 +574,18 @@ discard block |
||
| 571 | 574 | return wp_json_encode( $data ); |
| 572 | 575 | } |
| 573 | 576 | |
| 577 | + /** |
|
| 578 | + * @param string $needle |
|
| 579 | + */ |
|
| 574 | 580 | function ends_with( $haystack, $needle ) { |
| 575 | 581 | return $needle === substr( $haystack, -strlen( $needle ) ); |
| 576 | 582 | } |
| 577 | 583 | |
| 578 | 584 | // Returns the site's blog_id in the WP.com ecosystem |
| 585 | + |
|
| 586 | + /** |
|
| 587 | + * @return integer |
|
| 588 | + */ |
|
| 579 | 589 | function get_blog_id_for_output() { |
| 580 | 590 | return $this->token_details['blog_id']; |
| 581 | 591 | } |
@@ -598,6 +608,10 @@ discard block |
||
| 598 | 608 | } |
| 599 | 609 | |
| 600 | 610 | // Returns true if the specified blog ID is a restricted blog |
| 611 | + |
|
| 612 | + /** |
|
| 613 | + * @param integer $blog_id |
|
| 614 | + */ |
|
| 601 | 615 | function is_restricted_blog( $blog_id ) { |
| 602 | 616 | /** |
| 603 | 617 | * Filters all REST API access and return a 403 unauthorized response for all Restricted blog IDs. |
@@ -647,7 +661,7 @@ discard block |
||
| 647 | 661 | /** |
| 648 | 662 | * Counts the number of comments on a site, excluding certain comment types. |
| 649 | 663 | * |
| 650 | - * @param $post_id int Post ID. |
|
| 664 | + * @param integer $post_id int Post ID. |
|
| 651 | 665 | * @return array Array of counts, matching the output of https://developer.wordpress.org/reference/functions/get_comment_count/. |
| 652 | 666 | */ |
| 653 | 667 | public function wp_count_comments( $post_id ) { |