@@ -687,7 +687,6 @@ |
||
687 | 687 | * resized and cropped image. |
688 | 688 | * |
689 | 689 | * @param string $src |
690 | - * @param int $dimension |
|
691 | 690 | * @return string Transformed image URL |
692 | 691 | */ |
693 | 692 | static function fit_image_url( $src, $width, $height ) { |
@@ -956,7 +956,7 @@ discard block |
||
956 | 956 | * This is ported over from the manage module, which has been deprecated and baked in here. |
957 | 957 | * |
958 | 958 | * @param $domains |
959 | - * @return array |
|
959 | + * @return string[] |
|
960 | 960 | */ |
961 | 961 | function allow_wpcom_domain( $domains ) { |
962 | 962 | if ( empty( $domains ) ) { |
@@ -1324,7 +1324,7 @@ discard block |
||
1324 | 1324 | /** |
1325 | 1325 | * Does the network allow admins to add new users. |
1326 | 1326 | * |
1327 | - * @return boolian |
|
1327 | + * @return boolean |
|
1328 | 1328 | */ |
1329 | 1329 | static function network_add_new_users( $option = null ) { |
1330 | 1330 | return (bool) get_site_option( 'add_new_users' ); |
@@ -1434,7 +1434,7 @@ discard block |
||
1434 | 1434 | * |
1435 | 1435 | * @param bool $option |
1436 | 1436 | * |
1437 | - * @return boolean |
|
1437 | + * @return string |
|
1438 | 1438 | */ |
1439 | 1439 | public function is_main_network_option( $option ) { |
1440 | 1440 | // return '1' or '' |
@@ -1445,7 +1445,7 @@ discard block |
||
1445 | 1445 | * Return true if we are with multi-site or multi-network false if we are dealing with single site. |
1446 | 1446 | * |
1447 | 1447 | * @param string $option |
1448 | - * @return boolean |
|
1448 | + * @return string |
|
1449 | 1449 | */ |
1450 | 1450 | public function is_multisite( $option ) { |
1451 | 1451 | return (string) (bool) is_multisite(); |
@@ -1508,7 +1508,7 @@ discard block |
||
1508 | 1508 | /** |
1509 | 1509 | * Returns true if the site has file write access false otherwise. |
1510 | 1510 | * |
1511 | - * @return string ( '1' | '0' ) |
|
1511 | + * @return integer ( '1' | '0' ) |
|
1512 | 1512 | **/ |
1513 | 1513 | public static function file_system_write_access() { |
1514 | 1514 | if ( ! function_exists( 'get_filesystem_method' ) ) { |
@@ -2237,7 +2237,7 @@ discard block |
||
2237 | 2237 | * @param int $user_id The user id. |
2238 | 2238 | * @param string $token The user token. |
2239 | 2239 | * @param bool $is_master_user Whether the user is the master user. |
2240 | - * @return bool |
|
2240 | + * @return boolean|null |
|
2241 | 2241 | */ |
2242 | 2242 | public static function update_user_token( $user_id, $token, $is_master_user ) { |
2243 | 2243 | _deprecated_function( __METHOD__, 'jetpack-8.0', 'Automattic\\Jetpack\\Connection\\Utils::update_user_token' ); |
@@ -2681,7 +2681,7 @@ discard block |
||
2681 | 2681 | * |
2682 | 2682 | * @param string $tag Tag as it appears in each module heading. |
2683 | 2683 | * |
2684 | - * @return mixed |
|
2684 | + * @return string |
|
2685 | 2685 | */ |
2686 | 2686 | public static function translate_module_tag( $tag ) { |
2687 | 2687 | return jetpack_get_module_i18n_tag( $tag ); |
@@ -2796,8 +2796,8 @@ discard block |
||
2796 | 2796 | * Rewrites ABSPATH (eg `/home/jetpack/wordpress/`) to ABSPATH, and if WP_CONTENT_DIR |
2797 | 2797 | * is located outside of ABSPATH, rewrites that to WP_CONTENT_DIR. |
2798 | 2798 | * |
2799 | - * @param $string |
|
2800 | - * @return mixed |
|
2799 | + * @param string $string |
|
2800 | + * @return string|null |
|
2801 | 2801 | */ |
2802 | 2802 | public static function alias_directories( $string ) { |
2803 | 2803 | // ABSPATH has a trailing slash. |
@@ -2808,6 +2808,10 @@ discard block |
||
2808 | 2808 | return $string; |
2809 | 2809 | } |
2810 | 2810 | |
2811 | + /** |
|
2812 | + * @param boolean $redirect |
|
2813 | + * @param boolean $send_state_messages |
|
2814 | + */ |
|
2811 | 2815 | public static function activate_default_modules( |
2812 | 2816 | $min_version = false, |
2813 | 2817 | $max_version = false, |
@@ -3091,6 +3095,9 @@ discard block |
||
3091 | 3095 | return self::update_active_modules( $new ); |
3092 | 3096 | } |
3093 | 3097 | |
3098 | + /** |
|
3099 | + * @param string $module |
|
3100 | + */ |
|
3094 | 3101 | public static function enable_module_configurable( $module ) { |
3095 | 3102 | $module = self::get_module_slug( $module ); |
3096 | 3103 | add_filter( 'jetpack_module_configurable_' . $module, '__return_true' ); |
@@ -3119,6 +3126,10 @@ discard block |
||
3119 | 3126 | } |
3120 | 3127 | |
3121 | 3128 | /* Installation */ |
3129 | + |
|
3130 | + /** |
|
3131 | + * @param string $message |
|
3132 | + */ |
|
3122 | 3133 | public static function bail_on_activation( $message, $deactivate = true ) { |
3123 | 3134 | ?> |
3124 | 3135 | <!doctype html> |
@@ -3164,6 +3175,7 @@ discard block |
||
3164 | 3175 | * Attached to activate_{ plugin_basename( __FILES__ ) } by register_activation_hook() |
3165 | 3176 | * |
3166 | 3177 | * @static |
3178 | + * @param boolean $network_wide |
|
3167 | 3179 | */ |
3168 | 3180 | public static function plugin_activation( $network_wide ) { |
3169 | 3181 | Jetpack_Options::update_option( 'activated', 1 ); |
@@ -3884,7 +3896,7 @@ discard block |
||
3884 | 3896 | * Add help to the Jetpack page |
3885 | 3897 | * |
3886 | 3898 | * @since Jetpack (1.2.3) |
3887 | - * @return false if not the Jetpack page |
|
3899 | + * @return false|null if not the Jetpack page |
|
3888 | 3900 | */ |
3889 | 3901 | function admin_help() { |
3890 | 3902 | $current_screen = get_current_screen(); |
@@ -4588,6 +4600,7 @@ discard block |
||
4588 | 4600 | |
4589 | 4601 | /** |
4590 | 4602 | * Record a stat for later output. This will only currently output in the admin_footer. |
4603 | + * @param string $group |
|
4591 | 4604 | */ |
4592 | 4605 | function stat( $group, $detail ) { |
4593 | 4606 | $this->initialize_stats(); |
@@ -5001,6 +5014,9 @@ discard block |
||
5001 | 5014 | return $url; |
5002 | 5015 | } |
5003 | 5016 | |
5017 | + /** |
|
5018 | + * @param string $actionurl |
|
5019 | + */ |
|
5004 | 5020 | public static function nonce_url_no_esc( $actionurl, $action = -1, $name = '_wpnonce' ) { |
5005 | 5021 | $actionurl = str_replace( '&', '&', $actionurl ); |
5006 | 5022 | return add_query_arg( $name, wp_create_nonce( $action ), $actionurl ); |
@@ -5291,12 +5307,15 @@ discard block |
||
5291 | 5307 | * @param String $action The action name. |
5292 | 5308 | * @param Integer $user_id The user identifier. |
5293 | 5309 | * @param Integer $exp Expiration time in seconds. |
5294 | - * @return array |
|
5310 | + * @return boolean |
|
5295 | 5311 | */ |
5296 | 5312 | public static function generate_secrets( $action, $user_id = false, $exp = 600 ) { |
5297 | 5313 | return self::connection()->generate_secrets( $action, $user_id, $exp ); |
5298 | 5314 | } |
5299 | 5315 | |
5316 | + /** |
|
5317 | + * @param string $action |
|
5318 | + */ |
|
5300 | 5319 | public static function get_secrets( $action, $user_id ) { |
5301 | 5320 | $secrets = self::connection()->get_secrets( $action, $user_id ); |
5302 | 5321 | |
@@ -5547,7 +5566,6 @@ discard block |
||
5547 | 5566 | * @deprecated since 8.9.0 |
5548 | 5567 | * @see Automattic\Jetpack\Connection\Rest_Authentication::wp_rest_authentication_errors() |
5549 | 5568 | * |
5550 | - * @param WP_Error|mixed $result Error from another authentication handler, null if we should handle it, or another value if not |
|
5551 | 5569 | * @return WP_Error|boolean|null {@see WP_JSON_Server::check_authentication} |
5552 | 5570 | */ |
5553 | 5571 | public function wp_rest_authentication_errors( $value ) { |
@@ -5640,6 +5658,7 @@ discard block |
||
5640 | 5658 | * @param string $key |
5641 | 5659 | * @param string $value |
5642 | 5660 | * @param bool $restate private |
5661 | + * @return string |
|
5643 | 5662 | */ |
5644 | 5663 | public static function state( $key = null, $value = null, $restate = false ) { |
5645 | 5664 | static $state = array(); |
@@ -5721,6 +5740,9 @@ discard block |
||
5721 | 5740 | return true; |
5722 | 5741 | } |
5723 | 5742 | |
5743 | + /** |
|
5744 | + * @param string $file |
|
5745 | + */ |
|
5724 | 5746 | public static function check_privacy( $file ) { |
5725 | 5747 | static $is_site_publicly_accessible = null; |
5726 | 5748 | |
@@ -6293,9 +6315,7 @@ discard block |
||
6293 | 6315 | * |
6294 | 6316 | * Attached to `style_loader_src` filter. |
6295 | 6317 | * |
6296 | - * @param string $tag The tag that would link to the external asset. |
|
6297 | 6318 | * @param string $handle The registered handle of the script in question. |
6298 | - * @param string $href The url of the asset in question. |
|
6299 | 6319 | */ |
6300 | 6320 | public static function set_suffix_on_min( $src, $handle ) { |
6301 | 6321 | if ( false === strpos( $src, '.min.css' ) ) { |
@@ -6671,8 +6691,8 @@ discard block |
||
6671 | 6691 | * - Absolute URLs `http://domain.com/feh.png` |
6672 | 6692 | * - Domain root relative URLs `/feh.png` |
6673 | 6693 | * |
6674 | - * @param $css string: The raw CSS -- should be read in directly from the file. |
|
6675 | - * @param $css_file_url : The URL that the file can be accessed at, for calculating paths from. |
|
6694 | + * @param string $css string: The raw CSS -- should be read in directly from the file. |
|
6695 | + * @param string $css_file_url : The URL that the file can be accessed at, for calculating paths from. |
|
6676 | 6696 | * |
6677 | 6697 | * @return mixed|string |
6678 | 6698 | */ |
@@ -6971,7 +6991,6 @@ discard block |
||
6971 | 6991 | } |
6972 | 6992 | |
6973 | 6993 | /** |
6974 | - * @param mixed $result Value for the user's option |
|
6975 | 6994 | * @return mixed |
6976 | 6995 | */ |
6977 | 6996 | function get_user_option_meta_box_order_dashboard( $sorted ) { |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | * |
104 | 104 | * @param object $attachment The attachment object. |
105 | 105 | * |
106 | - * @return false|int |
|
106 | + * @return boolean |
|
107 | 107 | */ |
108 | 108 | public function is_video( $attachment ) { |
109 | 109 | return isset( $attachment->post_mime_type ) && wp_startswith( $attachment->post_mime_type, 'video/' ); |
@@ -113,8 +113,8 @@ discard block |
||
113 | 113 | * Removes the jetpack_videopress field from the response if the |
114 | 114 | * given attachment is not a video. |
115 | 115 | * |
116 | - * @param WP_REST_Response $response Response from the attachment endpoint. |
|
117 | - * @param WP_Post $attachment The original attachment object. |
|
116 | + * @param stdClass $response Response from the attachment endpoint. |
|
117 | + * @param stdClass $attachment The original attachment object. |
|
118 | 118 | * |
119 | 119 | * @return mixed |
120 | 120 | */ |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | * @param mixed $object Response from the attachment endpoint. |
147 | 147 | * @param WP_REST_Request $request Request to the attachment endpoint. |
148 | 148 | * |
149 | - * @return true |
|
149 | + * @return boolean |
|
150 | 150 | */ |
151 | 151 | public function get_permission_check( $object, $request ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable |
152 | 152 | return true; |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | * @param WP_Post $object The attachment object. |
161 | 161 | * @param WP_REST_Request $request Request to the attachment endpoint. |
162 | 162 | * |
163 | - * @return true |
|
163 | + * @return boolean |
|
164 | 164 | */ |
165 | 165 | public function update_permission_check( $value, $object, $request ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable |
166 | 166 | return true; |
@@ -100,7 +100,7 @@ |
||
100 | 100 | * |
101 | 101 | * @param string $class_name The name of the class to autoload. |
102 | 102 | * |
103 | - * @return bool Indicates whether or not a class file was loaded. |
|
103 | + * @return null|boolean Indicates whether or not a class file was loaded. |
|
104 | 104 | */ |
105 | 105 | public static function load_class( $class_name ) { |
106 | 106 | global $jetpack_autoloader_loader; |
@@ -186,7 +186,7 @@ |
||
186 | 186 | * Sign a string with a given key and algorithm. |
187 | 187 | * |
188 | 188 | * @param string $msg The message to sign. |
189 | - * @param string|resource $key The secret key. |
|
189 | + * @param string $key The secret key. |
|
190 | 190 | * @param string $alg The signing algorithm. |
191 | 191 | * Supported algorithms are 'HS256', 'HS384', 'HS512' and 'RS256'. |
192 | 192 | * |
@@ -149,7 +149,7 @@ |
||
149 | 149 | /** |
150 | 150 | * Get the token stored in the auth cookie. |
151 | 151 | * |
152 | - * @return ?string |
|
152 | + * @return string |
|
153 | 153 | */ |
154 | 154 | private function token_from_cookie() { |
155 | 155 | if ( isset( $_COOKIE[ self::JWT_AUTH_TOKEN_COOKIE_NAME ] ) ) { |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | * |
92 | 92 | * @param $function array A function structure to apply to the query |
93 | 93 | * |
94 | - * @return void |
|
94 | + * @return Jetpack_WPES_Query_Builder |
|
95 | 95 | */ |
96 | 96 | public function add_weighting_function( $function ) { |
97 | 97 | // check for danger. |
@@ -114,10 +114,10 @@ discard block |
||
114 | 114 | * |
115 | 115 | * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-function-score-query.html |
116 | 116 | * |
117 | - * @param $function string name of the function |
|
117 | + * @param string $function string name of the function |
|
118 | 118 | * @param $params array functions parameters |
119 | 119 | * |
120 | - * @return void |
|
120 | + * @return Jetpack_WPES_Query_Builder |
|
121 | 121 | */ |
122 | 122 | public function add_function( $function, $params ) { |
123 | 123 | $this->functions[ $function ][] = $params; |
@@ -133,10 +133,10 @@ discard block |
||
133 | 133 | * |
134 | 134 | * @see https://www.elastic.co/guide/en/elasticsearch/guide/current/decay-functions.html |
135 | 135 | * |
136 | - * @param $function string name of the decay function - linear, exp, or gauss |
|
136 | + * @param string $function string name of the decay function - linear, exp, or gauss |
|
137 | 137 | * @param $params array The decay functions parameters, passed to ES directly |
138 | 138 | * |
139 | - * @return void |
|
139 | + * @return Jetpack_WPES_Query_Builder |
|
140 | 140 | */ |
141 | 141 | public function add_decay( $function, $params ) { |
142 | 142 | $this->decays[ $function ][] = $params; |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | * |
152 | 152 | * @param $mode string name of how to score |
153 | 153 | * |
154 | - * @return void |
|
154 | + * @return Jetpack_WPES_Query_Builder |
|
155 | 155 | */ |
156 | 156 | public function add_score_mode_to_functions( $mode='multiply' ) { |
157 | 157 | $this->functions_score_mode = $mode; |
@@ -177,6 +177,9 @@ discard block |
||
177 | 177 | return $this; |
178 | 178 | } |
179 | 179 | |
180 | + /** |
|
181 | + * @param string $aggs_name |
|
182 | + */ |
|
180 | 183 | public function add_aggs( $aggs_name, $aggs ) { |
181 | 184 | $this->aggs_query = true; |
182 | 185 | $this->aggs[$aggs_name] = $aggs; |
@@ -22,6 +22,7 @@ discard block |
||
22 | 22 | |
23 | 23 | /** |
24 | 24 | * Scan every PHP in the root |
25 | + * @param string $root |
|
25 | 26 | */ |
26 | 27 | public function scan( $root, $exclude = array() ) { |
27 | 28 | if ( is_dir( $root ) ) { |
@@ -33,6 +34,9 @@ discard block |
||
33 | 34 | } |
34 | 35 | } |
35 | 36 | |
37 | + /** |
|
38 | + * @param string $root |
|
39 | + */ |
|
36 | 40 | public function scan_dir( $root, $exclude = array() ) { |
37 | 41 | |
38 | 42 | if ( is_null( $exclude ) || ! is_array( $exclude ) ) { |
@@ -639,6 +639,7 @@ discard block |
||
639 | 639 | * Fetch latest Jetpack version. |
640 | 640 | * |
641 | 641 | * @param bool $is_dev_version - If JP Dev version is being queried. |
642 | + * @return string |
|
642 | 643 | */ |
643 | 644 | public static function get_new_jetpack_version( $is_dev_version = false ) { |
644 | 645 | $manifest = self::get_beta_manifest(); |
@@ -714,6 +715,7 @@ discard block |
||
714 | 715 | * |
715 | 716 | * @param string $branch - Branch. |
716 | 717 | * @param string $section - Section. |
718 | + * @return string |
|
717 | 719 | */ |
718 | 720 | public static function get_install_url( $branch = null, $section = null ) { |
719 | 721 | if ( is_null( $section ) ) { |
@@ -769,7 +771,7 @@ discard block |
||
769 | 771 | /** |
770 | 772 | * Get JP plugin data. |
771 | 773 | * |
772 | - * @param mixed $plugin_file - JP or JP Dev plugin path. |
|
774 | + * @param string $plugin_file - JP or JP Dev plugin path. |
|
773 | 775 | */ |
774 | 776 | public static function get_jetpack_plugin_info( $plugin_file = null ) { |
775 | 777 | |
@@ -1418,7 +1420,7 @@ discard block |
||
1418 | 1420 | /** |
1419 | 1421 | * Checks if a dir is empty. |
1420 | 1422 | * |
1421 | - * @param [type] $dir The absolute directory path to check. |
|
1423 | + * @param string $dir The absolute directory path to check. |
|
1422 | 1424 | * @return boolean |
1423 | 1425 | */ |
1424 | 1426 | public static function is_dir_empty( $dir ) { |