@@ -1112,7 +1112,7 @@ discard block |
||
1112 | 1112 | } |
1113 | 1113 | /** |
1114 | 1114 | * Does the network allow admins to add new users. |
1115 | - * @return boolian |
|
1115 | + * @return boolean |
|
1116 | 1116 | */ |
1117 | 1117 | static function network_add_new_users( $option = null ) { |
1118 | 1118 | return (bool) get_site_option( 'add_new_users' ); |
@@ -1217,7 +1217,7 @@ discard block |
||
1217 | 1217 | * database which could be set to anything as opposed to what this function returns. |
1218 | 1218 | * @param bool $option |
1219 | 1219 | * |
1220 | - * @return boolean |
|
1220 | + * @return string |
|
1221 | 1221 | */ |
1222 | 1222 | public function is_main_network_option( $option ) { |
1223 | 1223 | // return '1' or '' |
@@ -1228,7 +1228,7 @@ discard block |
||
1228 | 1228 | * Return true if we are with multi-site or multi-network false if we are dealing with single site. |
1229 | 1229 | * |
1230 | 1230 | * @param string $option |
1231 | - * @return boolean |
|
1231 | + * @return string |
|
1232 | 1232 | */ |
1233 | 1233 | public function is_multisite( $option ) { |
1234 | 1234 | return (string) (bool) is_multisite(); |
@@ -1290,7 +1290,7 @@ discard block |
||
1290 | 1290 | |
1291 | 1291 | /** |
1292 | 1292 | * Returns true if the site has file write access false otherwise. |
1293 | - * @return string ( '1' | '0' ) |
|
1293 | + * @return integer ( '1' | '0' ) |
|
1294 | 1294 | **/ |
1295 | 1295 | public static function file_system_write_access() { |
1296 | 1296 | if ( ! function_exists( 'get_filesystem_method' ) ) { |
@@ -2119,6 +2119,7 @@ discard block |
||
2119 | 2119 | * @param int $user_id |
2120 | 2120 | * @param string $token |
2121 | 2121 | * return bool |
2122 | + * @param boolean $is_master_user |
|
2122 | 2123 | */ |
2123 | 2124 | public static function update_user_token( $user_id, $token, $is_master_user ) { |
2124 | 2125 | // not designed for concurrent updates |
@@ -2521,6 +2522,7 @@ discard block |
||
2521 | 2522 | |
2522 | 2523 | /** |
2523 | 2524 | * Like core's get_file_data implementation, but caches the result. |
2525 | + * @param string $file |
|
2524 | 2526 | */ |
2525 | 2527 | public static function get_file_data( $file, $headers ) { |
2526 | 2528 | //Get just the filename from $file (i.e. exclude full path) so that a consistent hash is generated |
@@ -2557,7 +2559,7 @@ discard block |
||
2557 | 2559 | * |
2558 | 2560 | * @param string $tag Tag as it appears in each module heading. |
2559 | 2561 | * |
2560 | - * @return mixed |
|
2562 | + * @return string |
|
2561 | 2563 | */ |
2562 | 2564 | public static function translate_module_tag( $tag ) { |
2563 | 2565 | return jetpack_get_module_i18n_tag( $tag ); |
@@ -2672,8 +2674,8 @@ discard block |
||
2672 | 2674 | * Rewrites ABSPATH (eg `/home/jetpack/wordpress/`) to ABSPATH, and if WP_CONTENT_DIR |
2673 | 2675 | * is located outside of ABSPATH, rewrites that to WP_CONTENT_DIR. |
2674 | 2676 | * |
2675 | - * @param $string |
|
2676 | - * @return mixed |
|
2677 | + * @param string $string |
|
2678 | + * @return string|null |
|
2677 | 2679 | */ |
2678 | 2680 | public static function alias_directories( $string ) { |
2679 | 2681 | // ABSPATH has a trailing slash. |
@@ -2953,6 +2955,9 @@ discard block |
||
2953 | 2955 | return self::update_active_modules( $new ); |
2954 | 2956 | } |
2955 | 2957 | |
2958 | + /** |
|
2959 | + * @param string $module |
|
2960 | + */ |
|
2956 | 2961 | public static function enable_module_configurable( $module ) { |
2957 | 2962 | $module = Jetpack::get_module_slug( $module ); |
2958 | 2963 | add_filter( 'jetpack_module_configurable_' . $module, '__return_true' ); |
@@ -2963,21 +2968,33 @@ discard block |
||
2963 | 2968 | return Jetpack::admin_url( array( 'page' => 'jetpack', 'configure' => $module ) ); |
2964 | 2969 | } |
2965 | 2970 | |
2971 | + /** |
|
2972 | + * @param string $module |
|
2973 | + */ |
|
2966 | 2974 | public static function module_configuration_load( $module, $method ) { |
2967 | 2975 | $module = Jetpack::get_module_slug( $module ); |
2968 | 2976 | add_action( 'jetpack_module_configuration_load_' . $module, $method ); |
2969 | 2977 | } |
2970 | 2978 | |
2979 | + /** |
|
2980 | + * @param string $module |
|
2981 | + */ |
|
2971 | 2982 | public static function module_configuration_head( $module, $method ) { |
2972 | 2983 | $module = Jetpack::get_module_slug( $module ); |
2973 | 2984 | add_action( 'jetpack_module_configuration_head_' . $module, $method ); |
2974 | 2985 | } |
2975 | 2986 | |
2987 | + /** |
|
2988 | + * @param string $module |
|
2989 | + */ |
|
2976 | 2990 | public static function module_configuration_screen( $module, $method ) { |
2977 | 2991 | $module = Jetpack::get_module_slug( $module ); |
2978 | 2992 | add_action( 'jetpack_module_configuration_screen_' . $module, $method ); |
2979 | 2993 | } |
2980 | 2994 | |
2995 | + /** |
|
2996 | + * @param string $module |
|
2997 | + */ |
|
2981 | 2998 | public static function module_configuration_activation_screen( $module, $method ) { |
2982 | 2999 | $module = Jetpack::get_module_slug( $module ); |
2983 | 3000 | add_action( 'display_activate_module_setting_' . $module, $method ); |
@@ -2985,6 +3002,9 @@ discard block |
||
2985 | 3002 | |
2986 | 3003 | /* Installation */ |
2987 | 3004 | |
3005 | + /** |
|
3006 | + * @param string $message |
|
3007 | + */ |
|
2988 | 3008 | public static function bail_on_activation( $message, $deactivate = true ) { |
2989 | 3009 | ?> |
2990 | 3010 | <!doctype html> |
@@ -3741,7 +3761,7 @@ discard block |
||
3741 | 3761 | * Add help to the Jetpack page |
3742 | 3762 | * |
3743 | 3763 | * @since Jetpack (1.2.3) |
3744 | - * @return false if not the Jetpack page |
|
3764 | + * @return false|null if not the Jetpack page |
|
3745 | 3765 | */ |
3746 | 3766 | function admin_help() { |
3747 | 3767 | $current_screen = get_current_screen(); |
@@ -4843,6 +4863,7 @@ discard block |
||
4843 | 4863 | /** |
4844 | 4864 | * Returns the requested Jetpack API URL |
4845 | 4865 | * |
4866 | + * @param string $relative_url |
|
4846 | 4867 | * @return string |
4847 | 4868 | */ |
4848 | 4869 | public static function api_url( $relative_url ) { |
@@ -5034,6 +5055,7 @@ discard block |
||
5034 | 5055 | * Note these tokens are unique per call, NOT static per site for connecting. |
5035 | 5056 | * |
5036 | 5057 | * @since 2.6 |
5058 | + * @param string $action |
|
5037 | 5059 | * @return array |
5038 | 5060 | */ |
5039 | 5061 | public static function generate_secrets( $action, $user_id = false, $exp = 600 ) { |
@@ -5586,7 +5608,6 @@ discard block |
||
5586 | 5608 | /** |
5587 | 5609 | * Report authentication status to the WP REST API. |
5588 | 5610 | * |
5589 | - * @param WP_Error|mixed $result Error from another authentication handler, null if we should handle it, or another value if not |
|
5590 | 5611 | * @return WP_Error|boolean|null {@see WP_JSON_Server::check_authentication} |
5591 | 5612 | */ |
5592 | 5613 | public function wp_rest_authentication_errors( $value ) { |
@@ -5596,6 +5617,10 @@ discard block |
||
5596 | 5617 | return $this->rest_authentication_status; |
5597 | 5618 | } |
5598 | 5619 | |
5620 | + /** |
|
5621 | + * @param integer $timestamp |
|
5622 | + * @param string $nonce |
|
5623 | + */ |
|
5599 | 5624 | function add_nonce( $timestamp, $nonce ) { |
5600 | 5625 | global $wpdb; |
5601 | 5626 | static $nonces_used_this_request = array(); |
@@ -5741,6 +5766,7 @@ discard block |
||
5741 | 5766 | * @param string $key |
5742 | 5767 | * @param string $value |
5743 | 5768 | * @param bool $restate private |
5769 | + * @return string |
|
5744 | 5770 | */ |
5745 | 5771 | public static function state( $key = null, $value = null, $restate = false ) { |
5746 | 5772 | static $state = array(); |
@@ -5797,6 +5823,9 @@ discard block |
||
5797 | 5823 | Jetpack::state( null, null, true ); |
5798 | 5824 | } |
5799 | 5825 | |
5826 | + /** |
|
5827 | + * @param string $file |
|
5828 | + */ |
|
5800 | 5829 | public static function check_privacy( $file ) { |
5801 | 5830 | static $is_site_publicly_accessible = null; |
5802 | 5831 | |
@@ -6414,9 +6443,7 @@ discard block |
||
6414 | 6443 | * |
6415 | 6444 | * Attached to `style_loader_src` filter. |
6416 | 6445 | * |
6417 | - * @param string $tag The tag that would link to the external asset. |
|
6418 | 6446 | * @param string $handle The registered handle of the script in question. |
6419 | - * @param string $href The url of the asset in question. |
|
6420 | 6447 | */ |
6421 | 6448 | public static function set_suffix_on_min( $src, $handle ) { |
6422 | 6449 | if ( false === strpos( $src, '.min.css' ) ) { |
@@ -6593,8 +6620,8 @@ discard block |
||
6593 | 6620 | * - Absolute URLs `http://domain.com/feh.png` |
6594 | 6621 | * - Domain root relative URLs `/feh.png` |
6595 | 6622 | * |
6596 | - * @param $css string: The raw CSS -- should be read in directly from the file. |
|
6597 | - * @param $css_file_url : The URL that the file can be accessed at, for calculating paths from. |
|
6623 | + * @param string $css string: The raw CSS -- should be read in directly from the file. |
|
6624 | + * @param string $css_file_url : The URL that the file can be accessed at, for calculating paths from. |
|
6598 | 6625 | * |
6599 | 6626 | * @return mixed|string |
6600 | 6627 | */ |
@@ -6823,7 +6850,7 @@ discard block |
||
6823 | 6850 | * |
6824 | 6851 | * @param string $option_name |
6825 | 6852 | * |
6826 | - * @return bool |
|
6853 | + * @return false|null |
|
6827 | 6854 | */ |
6828 | 6855 | public static function jumpstart_has_updated_module_option( $option_name = '' ) { |
6829 | 6856 | // Bail if Jump Start has already been dismissed |
@@ -6864,7 +6891,7 @@ discard block |
||
6864 | 6891 | /** |
6865 | 6892 | * Stores and prints out domains to prefetch for page speed optimization. |
6866 | 6893 | * |
6867 | - * @param mixed $new_urls |
|
6894 | + * @param string[] $new_urls |
|
6868 | 6895 | */ |
6869 | 6896 | public static function dns_prefetch( $new_urls = null ) { |
6870 | 6897 | static $prefetch_urls = array(); |
@@ -6910,7 +6937,6 @@ discard block |
||
6910 | 6937 | } |
6911 | 6938 | |
6912 | 6939 | /** |
6913 | - * @param mixed $result Value for the user's option |
|
6914 | 6940 | * @return mixed |
6915 | 6941 | */ |
6916 | 6942 | function get_user_option_meta_box_order_dashboard( $sorted ) { |
@@ -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 | */ |
@@ -505,6 +505,9 @@ |
||
505 | 505 | public $service = ''; |
506 | 506 | public $total = 0; |
507 | 507 | |
508 | + /** |
|
509 | + * @param integer $total |
|
510 | + */ |
|
508 | 511 | public function __construct( $id, $total ) { |
509 | 512 | $services = new Sharing_Service(); |
510 | 513 | $this->id = esc_html( $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 |
@@ -64,6 +64,7 @@ discard block |
||
64 | 64 | |
65 | 65 | /** |
66 | 66 | * Remove a Publicize connection |
67 | + * @param boolean $service_name |
|
67 | 68 | */ |
68 | 69 | function disconnect( $service_name, $connection_id, $_blog_id = false, $_user_id = false, $force_delete = false ) { |
69 | 70 | return Jetpack_Keyring_Service_Helper::disconnect( $service_name, $connection_id, $_blog_id, $_user_id, $force_delete ); |
@@ -559,6 +560,9 @@ discard block |
||
559 | 560 | $this->options_save_other( 'google_plus' ); |
560 | 561 | } |
561 | 562 | |
563 | + /** |
|
564 | + * @param string $service_name |
|
565 | + */ |
|
562 | 566 | function options_save_other( $service_name ) { |
563 | 567 | // Nonce check |
564 | 568 | check_admin_referer( 'save_' . $service_name . '_token_' . $_REQUEST['connection'] ); |
@@ -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' ) { |