@@ -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; |
@@ -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; |
@@ -229,7 +229,7 @@ |
||
229 | 229 | * |
230 | 230 | * @param string $notify_moderator The value of the moderation_notify option OR if the comment is awaiting moderation. |
231 | 231 | * @param int $comment_id Comment ID. |
232 | - * @return boolean Returns false to shortcircuit the execution of wp_notify_moderator |
|
232 | + * @return string|false Returns false to shortcircuit the execution of wp_notify_moderator |
|
233 | 233 | */ |
234 | 234 | function jetpack_notify_moderator( $notify_moderator, $comment_id ) { |
235 | 235 | /* |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | * @param array $post_types - other post types. |
194 | 194 | * |
195 | 195 | * @see hook 'rest_api_allowed_post_types' |
196 | - * @return array |
|
196 | + * @return string[] |
|
197 | 197 | */ |
198 | 198 | public function allow_rest_api_types( $post_types ) { |
199 | 199 | $post_types[] = self::$post_type_plan; |
@@ -254,7 +254,7 @@ discard block |
||
254 | 254 | * (because it requires a plan upgrade or Stripe connection), and the |
255 | 255 | * button is a child of a Premium Content block. |
256 | 256 | * |
257 | - * @param WP_Block $block Recurring Payments block instance. |
|
257 | + * @param WP_Block|null $block Recurring Payments block instance. |
|
258 | 258 | * |
259 | 259 | * @return boolean |
260 | 260 | */ |
@@ -136,6 +136,10 @@ discard block |
||
136 | 136 | ); |
137 | 137 | } |
138 | 138 | |
139 | + /** |
|
140 | + * @param string $service_name |
|
141 | + * @param string $for |
|
142 | + */ |
|
139 | 143 | static function refresh_url( $service_name, $for ) { |
140 | 144 | return add_query_arg( |
141 | 145 | array( |
@@ -150,6 +154,10 @@ discard block |
||
150 | 154 | ); |
151 | 155 | } |
152 | 156 | |
157 | + /** |
|
158 | + * @param string $service_name |
|
159 | + * @param string $id |
|
160 | + */ |
|
153 | 161 | static function disconnect_url( $service_name, $id ) { |
154 | 162 | return add_query_arg( |
155 | 163 | array( |
@@ -980,7 +980,7 @@ discard block |
||
980 | 980 | * This is ported over from the manage module, which has been deprecated and baked in here. |
981 | 981 | * |
982 | 982 | * @param $domains |
983 | - * @return array |
|
983 | + * @return string[] |
|
984 | 984 | */ |
985 | 985 | function allow_wpcom_domain( $domains ) { |
986 | 986 | if ( empty( $domains ) ) { |
@@ -1381,7 +1381,7 @@ discard block |
||
1381 | 1381 | /** |
1382 | 1382 | * Does the network allow admins to add new users. |
1383 | 1383 | * |
1384 | - * @return boolian |
|
1384 | + * @return boolean |
|
1385 | 1385 | */ |
1386 | 1386 | static function network_add_new_users( $option = null ) { |
1387 | 1387 | return (bool) get_site_option( 'add_new_users' ); |
@@ -1491,7 +1491,7 @@ discard block |
||
1491 | 1491 | * |
1492 | 1492 | * @param bool $option |
1493 | 1493 | * |
1494 | - * @return boolean |
|
1494 | + * @return string |
|
1495 | 1495 | */ |
1496 | 1496 | public function is_main_network_option( $option ) { |
1497 | 1497 | // return '1' or '' |
@@ -1502,7 +1502,7 @@ discard block |
||
1502 | 1502 | * Return true if we are with multi-site or multi-network false if we are dealing with single site. |
1503 | 1503 | * |
1504 | 1504 | * @param string $option |
1505 | - * @return boolean |
|
1505 | + * @return string |
|
1506 | 1506 | */ |
1507 | 1507 | public function is_multisite( $option ) { |
1508 | 1508 | return (string) (bool) is_multisite(); |
@@ -1565,7 +1565,7 @@ discard block |
||
1565 | 1565 | /** |
1566 | 1566 | * Returns true if the site has file write access false otherwise. |
1567 | 1567 | * |
1568 | - * @return string ( '1' | '0' ) |
|
1568 | + * @return integer ( '1' | '0' ) |
|
1569 | 1569 | **/ |
1570 | 1570 | public static function file_system_write_access() { |
1571 | 1571 | if ( ! function_exists( 'get_filesystem_method' ) ) { |
@@ -2273,7 +2273,7 @@ discard block |
||
2273 | 2273 | * @param int $user_id The user id. |
2274 | 2274 | * @param string $token The user token. |
2275 | 2275 | * @param bool $is_master_user Whether the user is the master user. |
2276 | - * @return bool |
|
2276 | + * @return boolean|null |
|
2277 | 2277 | */ |
2278 | 2278 | public static function update_user_token( $user_id, $token, $is_master_user ) { |
2279 | 2279 | _deprecated_function( __METHOD__, 'jetpack-9.5', 'Automattic\\Jetpack\\Connection\\Tokens->update_user_token' ); |
@@ -2756,7 +2756,7 @@ discard block |
||
2756 | 2756 | * |
2757 | 2757 | * @param string $tag Tag as it appears in each module heading. |
2758 | 2758 | * |
2759 | - * @return mixed |
|
2759 | + * @return string |
|
2760 | 2760 | */ |
2761 | 2761 | public static function translate_module_tag( $tag ) { |
2762 | 2762 | return jetpack_get_module_i18n_tag( $tag ); |
@@ -2871,8 +2871,8 @@ discard block |
||
2871 | 2871 | * Rewrites ABSPATH (eg `/home/jetpack/wordpress/`) to ABSPATH, and if WP_CONTENT_DIR |
2872 | 2872 | * is located outside of ABSPATH, rewrites that to WP_CONTENT_DIR. |
2873 | 2873 | * |
2874 | - * @param $string |
|
2875 | - * @return mixed |
|
2874 | + * @param string $string |
|
2875 | + * @return string|null |
|
2876 | 2876 | */ |
2877 | 2877 | public static function alias_directories( $string ) { |
2878 | 2878 | // ABSPATH has a trailing slash. |
@@ -2883,6 +2883,11 @@ discard block |
||
2883 | 2883 | return $string; |
2884 | 2884 | } |
2885 | 2885 | |
2886 | + /** |
|
2887 | + * @param boolean $redirect |
|
2888 | + * @param boolean $send_state_messages |
|
2889 | + * @param boolean $requires_user_connection |
|
2890 | + */ |
|
2886 | 2891 | public static function activate_default_modules( |
2887 | 2892 | $min_version = false, |
2888 | 2893 | $max_version = false, |
@@ -3172,6 +3177,9 @@ discard block |
||
3172 | 3177 | return self::update_active_modules( $new ); |
3173 | 3178 | } |
3174 | 3179 | |
3180 | + /** |
|
3181 | + * @param string $module |
|
3182 | + */ |
|
3175 | 3183 | public static function enable_module_configurable( $module ) { |
3176 | 3184 | $module = self::get_module_slug( $module ); |
3177 | 3185 | add_filter( 'jetpack_module_configurable_' . $module, '__return_true' ); |
@@ -3200,6 +3208,10 @@ discard block |
||
3200 | 3208 | } |
3201 | 3209 | |
3202 | 3210 | /* Installation */ |
3211 | + |
|
3212 | + /** |
|
3213 | + * @param string $message |
|
3214 | + */ |
|
3203 | 3215 | public static function bail_on_activation( $message, $deactivate = true ) { |
3204 | 3216 | ?> |
3205 | 3217 | <!doctype html> |
@@ -3245,6 +3257,7 @@ discard block |
||
3245 | 3257 | * Attached to activate_{ plugin_basename( __FILES__ ) } by register_activation_hook() |
3246 | 3258 | * |
3247 | 3259 | * @static |
3260 | + * @param boolean $network_wide |
|
3248 | 3261 | */ |
3249 | 3262 | public static function plugin_activation( $network_wide ) { |
3250 | 3263 | Jetpack_Options::update_option( 'activated', 1 ); |
@@ -3961,7 +3974,7 @@ discard block |
||
3961 | 3974 | * Add help to the Jetpack page |
3962 | 3975 | * |
3963 | 3976 | * @since Jetpack (1.2.3) |
3964 | - * @return false if not the Jetpack page |
|
3977 | + * @return false|null if not the Jetpack page |
|
3965 | 3978 | */ |
3966 | 3979 | function admin_help() { |
3967 | 3980 | $current_screen = get_current_screen(); |
@@ -4702,6 +4715,7 @@ discard block |
||
4702 | 4715 | |
4703 | 4716 | /** |
4704 | 4717 | * Record a stat for later output. This will only currently output in the admin_footer. |
4718 | + * @param string $group |
|
4705 | 4719 | */ |
4706 | 4720 | function stat( $group, $detail ) { |
4707 | 4721 | $this->initialize_stats(); |
@@ -5064,6 +5078,9 @@ discard block |
||
5064 | 5078 | return $url; |
5065 | 5079 | } |
5066 | 5080 | |
5081 | + /** |
|
5082 | + * @param string $actionurl |
|
5083 | + */ |
|
5067 | 5084 | public static function nonce_url_no_esc( $actionurl, $action = -1, $name = '_wpnonce' ) { |
5068 | 5085 | $actionurl = str_replace( '&', '&', $actionurl ); |
5069 | 5086 | return add_query_arg( $name, wp_create_nonce( $action ), $actionurl ); |
@@ -5603,7 +5620,6 @@ discard block |
||
5603 | 5620 | * @deprecated since 8.9.0 |
5604 | 5621 | * @see Automattic\Jetpack\Connection\Rest_Authentication::wp_rest_authentication_errors() |
5605 | 5622 | * |
5606 | - * @param WP_Error|mixed $result Error from another authentication handler, null if we should handle it, or another value if not |
|
5607 | 5623 | * @return WP_Error|boolean|null {@see WP_JSON_Server::check_authentication} |
5608 | 5624 | */ |
5609 | 5625 | public function wp_rest_authentication_errors( $value ) { |
@@ -5696,6 +5712,7 @@ discard block |
||
5696 | 5712 | * @param string $key |
5697 | 5713 | * @param string $value |
5698 | 5714 | * @param bool $restate private |
5715 | + * @return string |
|
5699 | 5716 | */ |
5700 | 5717 | public static function state( $key = null, $value = null, $restate = false ) { |
5701 | 5718 | static $state = array(); |
@@ -5777,6 +5794,9 @@ discard block |
||
5777 | 5794 | return true; |
5778 | 5795 | } |
5779 | 5796 | |
5797 | + /** |
|
5798 | + * @param string $file |
|
5799 | + */ |
|
5780 | 5800 | public static function check_privacy( $file ) { |
5781 | 5801 | static $is_site_publicly_accessible = null; |
5782 | 5802 | |
@@ -6350,9 +6370,7 @@ discard block |
||
6350 | 6370 | * |
6351 | 6371 | * Attached to `style_loader_src` filter. |
6352 | 6372 | * |
6353 | - * @param string $tag The tag that would link to the external asset. |
|
6354 | 6373 | * @param string $handle The registered handle of the script in question. |
6355 | - * @param string $href The url of the asset in question. |
|
6356 | 6374 | */ |
6357 | 6375 | public static function set_suffix_on_min( $src, $handle ) { |
6358 | 6376 | if ( false === strpos( $src, '.min.css' ) ) { |
@@ -6728,8 +6746,8 @@ discard block |
||
6728 | 6746 | * - Absolute URLs `http://domain.com/feh.png` |
6729 | 6747 | * - Domain root relative URLs `/feh.png` |
6730 | 6748 | * |
6731 | - * @param $css string: The raw CSS -- should be read in directly from the file. |
|
6732 | - * @param $css_file_url : The URL that the file can be accessed at, for calculating paths from. |
|
6749 | + * @param string $css string: The raw CSS -- should be read in directly from the file. |
|
6750 | + * @param string $css_file_url : The URL that the file can be accessed at, for calculating paths from. |
|
6733 | 6751 | * |
6734 | 6752 | * @return mixed|string |
6735 | 6753 | */ |
@@ -7031,7 +7049,6 @@ discard block |
||
7031 | 7049 | } |
7032 | 7050 | |
7033 | 7051 | /** |
7034 | - * @param mixed $result Value for the user's option |
|
7035 | 7052 | * @return mixed |
7036 | 7053 | */ |
7037 | 7054 | function get_user_option_meta_box_order_dashboard( $sorted ) { |