@@ -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( |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | * Convenience function for grabbing options from params->options |
48 | 48 | * |
49 | 49 | * @param string $option the option to grab |
50 | - * @param mixed $default (optional) |
|
50 | + * @param boolean $default (optional) |
|
51 | 51 | * @return option or $default if not set |
52 | 52 | * |
53 | 53 | * @since 4.5.0 |
@@ -465,7 +465,7 @@ discard block |
||
465 | 465 | |
466 | 466 | /** |
467 | 467 | * Check the reasons to bail before we attempt to insert ads. |
468 | - * @return true if we should bail (don't insert ads) |
|
468 | + * @return boolean if we should bail (don't insert ads) |
|
469 | 469 | * |
470 | 470 | * @since 4.5.0 |
471 | 471 | */ |
@@ -75,6 +75,9 @@ |
||
75 | 75 | ); |
76 | 76 | } |
77 | 77 | |
78 | + /** |
|
79 | + * @param string $post_type |
|
80 | + */ |
|
78 | 81 | protected function localize_initial_taxonomies( $post_type ) { |
79 | 82 | /** This filter is documented in jetpack/json-endpoints/class.wpcom-json-api-list-post-types-endpoint.php */ |
80 | 83 | if ( ! apply_filters( 'rest_api_localize_response', false ) ) { |
@@ -177,6 +177,9 @@ |
||
177 | 177 | return true; |
178 | 178 | } |
179 | 179 | |
180 | + /** |
|
181 | + * @param string $role |
|
182 | + */ |
|
180 | 183 | function current_user_can( $role ) { |
181 | 184 | return current_user_can( $role ); |
182 | 185 | } |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | * Update the media post grabbing the post values from |
102 | 102 | * the `attrs` parameter |
103 | 103 | * |
104 | - * @param {Number} $media_id - post media ID |
|
104 | + * @param integer $media_id - post media ID |
|
105 | 105 | * @param {Object} $attrs - `attrs` parameter sent from the client in the request body |
106 | 106 | * @return |
107 | 107 | */ |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | * Save the given temporal file in a local folder. |
203 | 203 | * |
204 | 204 | * @param {Array} $file_array |
205 | - * @param {Number} $media_id |
|
205 | + * @param integer $media_id |
|
206 | 206 | * @return {Array|WP_Error} An array with information about the new file saved or a WP_Error is something went wrong. |
207 | 207 | */ |
208 | 208 | private function save_temporary_file( $file_array, $media_id ) { |
@@ -277,7 +277,7 @@ discard block |
||
277 | 277 | /** |
278 | 278 | * Get the image from a remote url and then save it locally. |
279 | 279 | * |
280 | - * @param {Number} $media_id - media post ID |
|
280 | + * @param integer $media_id - media post ID |
|
281 | 281 | * @param {String} $url - image URL to save locally |
282 | 282 | * @return {Array|WP_Error} An array with information about the new file saved or a WP_Error is something went wrong. |
283 | 283 | */ |
@@ -257,8 +257,7 @@ discard block |
||
257 | 257 | /** |
258 | 258 | * Gets the latests field value from either the old instance or the new instance. |
259 | 259 | * |
260 | - * @param array $mixed Array of values for the new form instance. |
|
261 | - * @param array $mixed Array of values for the old form instance. |
|
260 | + * @param string $field |
|
262 | 261 | * @return mixed $mixed Field value. |
263 | 262 | */ |
264 | 263 | private function get_latest_field_value( $new_instance, $old_instance, $field) { |
@@ -272,6 +271,7 @@ discard block |
||
272 | 271 | * it returns the default values. |
273 | 272 | * |
274 | 273 | * @param int Product Post ID. |
274 | + * @param integer $product_post_id |
|
275 | 275 | * @return array $fields Product Fields from the Product Post. |
276 | 276 | */ |
277 | 277 | private function get_product_from_post( $product_post_id ) { |
@@ -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) { |
@@ -175,7 +175,7 @@ |
||
175 | 175 | /** |
176 | 176 | * Back end function to abstract the xmlrpc function calls to wpcom. |
177 | 177 | * |
178 | - * @param $endpoint |
|
178 | + * @param string $endpoint |
|
179 | 179 | * @param $error_message |
180 | 180 | */ |
181 | 181 | function __process_ajax_proxy_request( $endpoint, $error_message ) { // phpcs:ignore |
@@ -1125,7 +1125,7 @@ discard block |
||
1125 | 1125 | } |
1126 | 1126 | /** |
1127 | 1127 | * Does the network allow admins to add new users. |
1128 | - * @return boolian |
|
1128 | + * @return boolean |
|
1129 | 1129 | */ |
1130 | 1130 | static function network_add_new_users( $option = null ) { |
1131 | 1131 | return (bool) get_site_option( 'add_new_users' ); |
@@ -1230,7 +1230,7 @@ discard block |
||
1230 | 1230 | * database which could be set to anything as opposed to what this function returns. |
1231 | 1231 | * @param bool $option |
1232 | 1232 | * |
1233 | - * @return boolean |
|
1233 | + * @return string |
|
1234 | 1234 | */ |
1235 | 1235 | public function is_main_network_option( $option ) { |
1236 | 1236 | // return '1' or '' |
@@ -1241,7 +1241,7 @@ discard block |
||
1241 | 1241 | * Return true if we are with multi-site or multi-network false if we are dealing with single site. |
1242 | 1242 | * |
1243 | 1243 | * @param string $option |
1244 | - * @return boolean |
|
1244 | + * @return string |
|
1245 | 1245 | */ |
1246 | 1246 | public function is_multisite( $option ) { |
1247 | 1247 | return (string) (bool) is_multisite(); |
@@ -1303,7 +1303,7 @@ discard block |
||
1303 | 1303 | |
1304 | 1304 | /** |
1305 | 1305 | * Returns true if the site has file write access false otherwise. |
1306 | - * @return string ( '1' | '0' ) |
|
1306 | + * @return integer ( '1' | '0' ) |
|
1307 | 1307 | **/ |
1308 | 1308 | public static function file_system_write_access() { |
1309 | 1309 | if ( ! function_exists( 'get_filesystem_method' ) ) { |
@@ -2157,6 +2157,7 @@ discard block |
||
2157 | 2157 | * @param int $user_id |
2158 | 2158 | * @param string $token |
2159 | 2159 | * return bool |
2160 | + * @param boolean $is_master_user |
|
2160 | 2161 | */ |
2161 | 2162 | public static function update_user_token( $user_id, $token, $is_master_user ) { |
2162 | 2163 | // not designed for concurrent updates |
@@ -2559,6 +2560,7 @@ discard block |
||
2559 | 2560 | |
2560 | 2561 | /** |
2561 | 2562 | * Like core's get_file_data implementation, but caches the result. |
2563 | + * @param string $file |
|
2562 | 2564 | */ |
2563 | 2565 | public static function get_file_data( $file, $headers ) { |
2564 | 2566 | //Get just the filename from $file (i.e. exclude full path) so that a consistent hash is generated |
@@ -2595,7 +2597,7 @@ discard block |
||
2595 | 2597 | * |
2596 | 2598 | * @param string $tag Tag as it appears in each module heading. |
2597 | 2599 | * |
2598 | - * @return mixed |
|
2600 | + * @return string |
|
2599 | 2601 | */ |
2600 | 2602 | public static function translate_module_tag( $tag ) { |
2601 | 2603 | return jetpack_get_module_i18n_tag( $tag ); |
@@ -2734,8 +2736,8 @@ discard block |
||
2734 | 2736 | * Rewrites ABSPATH (eg `/home/jetpack/wordpress/`) to ABSPATH, and if WP_CONTENT_DIR |
2735 | 2737 | * is located outside of ABSPATH, rewrites that to WP_CONTENT_DIR. |
2736 | 2738 | * |
2737 | - * @param $string |
|
2738 | - * @return mixed |
|
2739 | + * @param string $string |
|
2740 | + * @return string|null |
|
2739 | 2741 | */ |
2740 | 2742 | public static function alias_directories( $string ) { |
2741 | 2743 | // ABSPATH has a trailing slash. |
@@ -3013,6 +3015,9 @@ discard block |
||
3013 | 3015 | return self::update_active_modules( $new ); |
3014 | 3016 | } |
3015 | 3017 | |
3018 | + /** |
|
3019 | + * @param string $module |
|
3020 | + */ |
|
3016 | 3021 | public static function enable_module_configurable( $module ) { |
3017 | 3022 | $module = Jetpack::get_module_slug( $module ); |
3018 | 3023 | add_filter( 'jetpack_module_configurable_' . $module, '__return_true' ); |
@@ -3023,21 +3028,33 @@ discard block |
||
3023 | 3028 | return Jetpack::admin_url( array( 'page' => 'jetpack', 'configure' => $module ) ); |
3024 | 3029 | } |
3025 | 3030 | |
3031 | + /** |
|
3032 | + * @param string $module |
|
3033 | + */ |
|
3026 | 3034 | public static function module_configuration_load( $module, $method ) { |
3027 | 3035 | $module = Jetpack::get_module_slug( $module ); |
3028 | 3036 | add_action( 'jetpack_module_configuration_load_' . $module, $method ); |
3029 | 3037 | } |
3030 | 3038 | |
3039 | + /** |
|
3040 | + * @param string $module |
|
3041 | + */ |
|
3031 | 3042 | public static function module_configuration_head( $module, $method ) { |
3032 | 3043 | $module = Jetpack::get_module_slug( $module ); |
3033 | 3044 | add_action( 'jetpack_module_configuration_head_' . $module, $method ); |
3034 | 3045 | } |
3035 | 3046 | |
3047 | + /** |
|
3048 | + * @param string $module |
|
3049 | + */ |
|
3036 | 3050 | public static function module_configuration_screen( $module, $method ) { |
3037 | 3051 | $module = Jetpack::get_module_slug( $module ); |
3038 | 3052 | add_action( 'jetpack_module_configuration_screen_' . $module, $method ); |
3039 | 3053 | } |
3040 | 3054 | |
3055 | + /** |
|
3056 | + * @param string $module |
|
3057 | + */ |
|
3041 | 3058 | public static function module_configuration_activation_screen( $module, $method ) { |
3042 | 3059 | $module = Jetpack::get_module_slug( $module ); |
3043 | 3060 | add_action( 'display_activate_module_setting_' . $module, $method ); |
@@ -3045,6 +3062,9 @@ discard block |
||
3045 | 3062 | |
3046 | 3063 | /* Installation */ |
3047 | 3064 | |
3065 | + /** |
|
3066 | + * @param string $message |
|
3067 | + */ |
|
3048 | 3068 | public static function bail_on_activation( $message, $deactivate = true ) { |
3049 | 3069 | ?> |
3050 | 3070 | <!doctype html> |
@@ -3801,7 +3821,7 @@ discard block |
||
3801 | 3821 | * Add help to the Jetpack page |
3802 | 3822 | * |
3803 | 3823 | * @since Jetpack (1.2.3) |
3804 | - * @return false if not the Jetpack page |
|
3824 | + * @return false|null if not the Jetpack page |
|
3805 | 3825 | */ |
3806 | 3826 | function admin_help() { |
3807 | 3827 | $current_screen = get_current_screen(); |
@@ -4910,6 +4930,7 @@ discard block |
||
4910 | 4930 | /** |
4911 | 4931 | * Returns the requested Jetpack API URL |
4912 | 4932 | * |
4933 | + * @param string $relative_url |
|
4913 | 4934 | * @return string |
4914 | 4935 | */ |
4915 | 4936 | public static function api_url( $relative_url ) { |
@@ -5101,6 +5122,7 @@ discard block |
||
5101 | 5122 | * Note these tokens are unique per call, NOT static per site for connecting. |
5102 | 5123 | * |
5103 | 5124 | * @since 2.6 |
5125 | + * @param string $action |
|
5104 | 5126 | * @return array |
5105 | 5127 | */ |
5106 | 5128 | public static function generate_secrets( $action, $user_id = false, $exp = 600 ) { |
@@ -5653,7 +5675,6 @@ discard block |
||
5653 | 5675 | /** |
5654 | 5676 | * Report authentication status to the WP REST API. |
5655 | 5677 | * |
5656 | - * @param WP_Error|mixed $result Error from another authentication handler, null if we should handle it, or another value if not |
|
5657 | 5678 | * @return WP_Error|boolean|null {@see WP_JSON_Server::check_authentication} |
5658 | 5679 | */ |
5659 | 5680 | public function wp_rest_authentication_errors( $value ) { |
@@ -5663,6 +5684,10 @@ discard block |
||
5663 | 5684 | return $this->rest_authentication_status; |
5664 | 5685 | } |
5665 | 5686 | |
5687 | + /** |
|
5688 | + * @param integer $timestamp |
|
5689 | + * @param string $nonce |
|
5690 | + */ |
|
5666 | 5691 | function add_nonce( $timestamp, $nonce ) { |
5667 | 5692 | global $wpdb; |
5668 | 5693 | static $nonces_used_this_request = array(); |
@@ -5808,6 +5833,7 @@ discard block |
||
5808 | 5833 | * @param string $key |
5809 | 5834 | * @param string $value |
5810 | 5835 | * @param bool $restate private |
5836 | + * @return string |
|
5811 | 5837 | */ |
5812 | 5838 | public static function state( $key = null, $value = null, $restate = false ) { |
5813 | 5839 | static $state = array(); |
@@ -5864,6 +5890,9 @@ discard block |
||
5864 | 5890 | Jetpack::state( null, null, true ); |
5865 | 5891 | } |
5866 | 5892 | |
5893 | + /** |
|
5894 | + * @param string $file |
|
5895 | + */ |
|
5867 | 5896 | public static function check_privacy( $file ) { |
5868 | 5897 | static $is_site_publicly_accessible = null; |
5869 | 5898 | |
@@ -6481,9 +6510,7 @@ discard block |
||
6481 | 6510 | * |
6482 | 6511 | * Attached to `style_loader_src` filter. |
6483 | 6512 | * |
6484 | - * @param string $tag The tag that would link to the external asset. |
|
6485 | 6513 | * @param string $handle The registered handle of the script in question. |
6486 | - * @param string $href The url of the asset in question. |
|
6487 | 6514 | */ |
6488 | 6515 | public static function set_suffix_on_min( $src, $handle ) { |
6489 | 6516 | if ( false === strpos( $src, '.min.css' ) ) { |
@@ -6662,8 +6689,8 @@ discard block |
||
6662 | 6689 | * - Absolute URLs `http://domain.com/feh.png` |
6663 | 6690 | * - Domain root relative URLs `/feh.png` |
6664 | 6691 | * |
6665 | - * @param $css string: The raw CSS -- should be read in directly from the file. |
|
6666 | - * @param $css_file_url : The URL that the file can be accessed at, for calculating paths from. |
|
6692 | + * @param string $css string: The raw CSS -- should be read in directly from the file. |
|
6693 | + * @param string $css_file_url : The URL that the file can be accessed at, for calculating paths from. |
|
6667 | 6694 | * |
6668 | 6695 | * @return mixed|string |
6669 | 6696 | */ |
@@ -6892,7 +6919,7 @@ discard block |
||
6892 | 6919 | * |
6893 | 6920 | * @param string $option_name |
6894 | 6921 | * |
6895 | - * @return bool |
|
6922 | + * @return false|null |
|
6896 | 6923 | */ |
6897 | 6924 | public static function jumpstart_has_updated_module_option( $option_name = '' ) { |
6898 | 6925 | // Bail if Jump Start has already been dismissed |
@@ -6936,6 +6963,10 @@ discard block |
||
6936 | 6963 | * $param string |
6937 | 6964 | * @return string |
6938 | 6965 | */ |
6966 | + |
|
6967 | + /** |
|
6968 | + * @param string $path |
|
6969 | + */ |
|
6939 | 6970 | public static function calyps_url( $path, $from = null ) { |
6940 | 6971 | $host = 'https://wordpress.com'; |
6941 | 6972 | |
@@ -6955,7 +6986,7 @@ discard block |
||
6955 | 6986 | /** |
6956 | 6987 | * Stores and prints out domains to prefetch for page speed optimization. |
6957 | 6988 | * |
6958 | - * @param mixed $new_urls |
|
6989 | + * @param string[] $new_urls |
|
6959 | 6990 | */ |
6960 | 6991 | public static function dns_prefetch( $new_urls = null ) { |
6961 | 6992 | static $prefetch_urls = array(); |
@@ -7001,7 +7032,6 @@ discard block |
||
7001 | 7032 | } |
7002 | 7033 | |
7003 | 7034 | /** |
7004 | - * @param mixed $result Value for the user's option |
|
7005 | 7035 | * @return mixed |
7006 | 7036 | */ |
7007 | 7037 | function get_user_option_meta_box_order_dashboard( $sorted ) { |