@@ -124,7 +124,7 @@ |
||
124 | 124 | * @param int $cutoff_timestamp All nonces added before this timestamp will be removed. |
125 | 125 | * @param int $time_limit How long the cleanup can run (in seconds). |
126 | 126 | * |
127 | - * @return true |
|
127 | + * @return boolean |
|
128 | 128 | */ |
129 | 129 | public function clean_all( $cutoff_timestamp = PHP_INT_MAX, $time_limit = 20 ) { |
130 | 130 | // phpcs:ignore Generic.CodeAnalysis.ForLoopWithTestFunctionCall.NotAllowed |
@@ -246,7 +246,7 @@ |
||
246 | 246 | * @param int $user_id The user id. |
247 | 247 | * @param string $token The user token. |
248 | 248 | * @param bool $is_master_user Whether the user is the master user. |
249 | - * @return bool |
|
249 | + * @return boolean|null |
|
250 | 250 | */ |
251 | 251 | public function update_user_token( $user_id, $token, $is_master_user ) { |
252 | 252 | // Not designed for concurrent updates. |
@@ -293,7 +293,7 @@ discard block |
||
293 | 293 | /** |
294 | 294 | * Verifies the signature of the current request. |
295 | 295 | * |
296 | - * @return false|array |
|
296 | + * @return boolean |
|
297 | 297 | */ |
298 | 298 | public function verify_xml_rpc_signature() { |
299 | 299 | if ( is_null( $this->xmlrpc_verification ) ) { |
@@ -1461,7 +1461,7 @@ discard block |
||
1461 | 1461 | /** |
1462 | 1462 | * Obtains the auth token. |
1463 | 1463 | * |
1464 | - * @param array $data The request data. |
|
1464 | + * @param string $data The request data. |
|
1465 | 1465 | * @return object|\WP_Error Returns the auth token on success. |
1466 | 1466 | * Returns a \WP_Error on failure. |
1467 | 1467 | */ |
@@ -2088,7 +2088,7 @@ discard block |
||
2088 | 2088 | * @deprecated 9.5 Use Automattic\Jetpack\Connection\Tokens->get_signed_token() instead. |
2089 | 2089 | * |
2090 | 2090 | * @param object $token the token. |
2091 | - * @return WP_Error|string a signed token |
|
2091 | + * @return string a signed token |
|
2092 | 2092 | */ |
2093 | 2093 | public function get_signed_token( $token ) { |
2094 | 2094 | _deprecated_function( __METHOD__, 'jetpack-9.5', 'Automattic\\Jetpack\\Connection\\Tokens->get_signed_token' ); |
@@ -978,7 +978,7 @@ discard block |
||
978 | 978 | * This is ported over from the manage module, which has been deprecated and baked in here. |
979 | 979 | * |
980 | 980 | * @param $domains |
981 | - * @return array |
|
981 | + * @return string[] |
|
982 | 982 | */ |
983 | 983 | function allow_wpcom_domain( $domains ) { |
984 | 984 | if ( empty( $domains ) ) { |
@@ -1379,7 +1379,7 @@ discard block |
||
1379 | 1379 | /** |
1380 | 1380 | * Does the network allow admins to add new users. |
1381 | 1381 | * |
1382 | - * @return boolian |
|
1382 | + * @return boolean |
|
1383 | 1383 | */ |
1384 | 1384 | static function network_add_new_users( $option = null ) { |
1385 | 1385 | return (bool) get_site_option( 'add_new_users' ); |
@@ -1489,7 +1489,7 @@ discard block |
||
1489 | 1489 | * |
1490 | 1490 | * @param bool $option |
1491 | 1491 | * |
1492 | - * @return boolean |
|
1492 | + * @return string |
|
1493 | 1493 | */ |
1494 | 1494 | public function is_main_network_option( $option ) { |
1495 | 1495 | // return '1' or '' |
@@ -1500,7 +1500,7 @@ discard block |
||
1500 | 1500 | * Return true if we are with multi-site or multi-network false if we are dealing with single site. |
1501 | 1501 | * |
1502 | 1502 | * @param string $option |
1503 | - * @return boolean |
|
1503 | + * @return string |
|
1504 | 1504 | */ |
1505 | 1505 | public function is_multisite( $option ) { |
1506 | 1506 | return (string) (bool) is_multisite(); |
@@ -1563,7 +1563,7 @@ discard block |
||
1563 | 1563 | /** |
1564 | 1564 | * Returns true if the site has file write access false otherwise. |
1565 | 1565 | * |
1566 | - * @return string ( '1' | '0' ) |
|
1566 | + * @return integer ( '1' | '0' ) |
|
1567 | 1567 | **/ |
1568 | 1568 | public static function file_system_write_access() { |
1569 | 1569 | if ( ! function_exists( 'get_filesystem_method' ) ) { |
@@ -2271,7 +2271,7 @@ discard block |
||
2271 | 2271 | * @param int $user_id The user id. |
2272 | 2272 | * @param string $token The user token. |
2273 | 2273 | * @param bool $is_master_user Whether the user is the master user. |
2274 | - * @return bool |
|
2274 | + * @return boolean|null |
|
2275 | 2275 | */ |
2276 | 2276 | public static function update_user_token( $user_id, $token, $is_master_user ) { |
2277 | 2277 | _deprecated_function( __METHOD__, 'jetpack-9.5', 'Automattic\\Jetpack\\Connection\\Tokens->update_user_token' ); |
@@ -2715,7 +2715,7 @@ discard block |
||
2715 | 2715 | * |
2716 | 2716 | * @param string $tag Tag as it appears in each module heading. |
2717 | 2717 | * |
2718 | - * @return mixed |
|
2718 | + * @return string |
|
2719 | 2719 | */ |
2720 | 2720 | public static function translate_module_tag( $tag ) { |
2721 | 2721 | return jetpack_get_module_i18n_tag( $tag ); |
@@ -2830,8 +2830,8 @@ discard block |
||
2830 | 2830 | * Rewrites ABSPATH (eg `/home/jetpack/wordpress/`) to ABSPATH, and if WP_CONTENT_DIR |
2831 | 2831 | * is located outside of ABSPATH, rewrites that to WP_CONTENT_DIR. |
2832 | 2832 | * |
2833 | - * @param $string |
|
2834 | - * @return mixed |
|
2833 | + * @param string $string |
|
2834 | + * @return string|null |
|
2835 | 2835 | */ |
2836 | 2836 | public static function alias_directories( $string ) { |
2837 | 2837 | // ABSPATH has a trailing slash. |
@@ -2842,6 +2842,10 @@ discard block |
||
2842 | 2842 | return $string; |
2843 | 2843 | } |
2844 | 2844 | |
2845 | + /** |
|
2846 | + * @param boolean $redirect |
|
2847 | + * @param boolean $send_state_messages |
|
2848 | + */ |
|
2845 | 2849 | public static function activate_default_modules( |
2846 | 2850 | $min_version = false, |
2847 | 2851 | $max_version = false, |
@@ -3125,6 +3129,9 @@ discard block |
||
3125 | 3129 | return self::update_active_modules( $new ); |
3126 | 3130 | } |
3127 | 3131 | |
3132 | + /** |
|
3133 | + * @param string $module |
|
3134 | + */ |
|
3128 | 3135 | public static function enable_module_configurable( $module ) { |
3129 | 3136 | $module = self::get_module_slug( $module ); |
3130 | 3137 | add_filter( 'jetpack_module_configurable_' . $module, '__return_true' ); |
@@ -3153,6 +3160,10 @@ discard block |
||
3153 | 3160 | } |
3154 | 3161 | |
3155 | 3162 | /* Installation */ |
3163 | + |
|
3164 | + /** |
|
3165 | + * @param string $message |
|
3166 | + */ |
|
3156 | 3167 | public static function bail_on_activation( $message, $deactivate = true ) { |
3157 | 3168 | ?> |
3158 | 3169 | <!doctype html> |
@@ -3198,6 +3209,7 @@ discard block |
||
3198 | 3209 | * Attached to activate_{ plugin_basename( __FILES__ ) } by register_activation_hook() |
3199 | 3210 | * |
3200 | 3211 | * @static |
3212 | + * @param boolean $network_wide |
|
3201 | 3213 | */ |
3202 | 3214 | public static function plugin_activation( $network_wide ) { |
3203 | 3215 | Jetpack_Options::update_option( 'activated', 1 ); |
@@ -3915,7 +3927,7 @@ discard block |
||
3915 | 3927 | * Add help to the Jetpack page |
3916 | 3928 | * |
3917 | 3929 | * @since Jetpack (1.2.3) |
3918 | - * @return false if not the Jetpack page |
|
3930 | + * @return false|null if not the Jetpack page |
|
3919 | 3931 | */ |
3920 | 3932 | function admin_help() { |
3921 | 3933 | $current_screen = get_current_screen(); |
@@ -4656,6 +4668,7 @@ discard block |
||
4656 | 4668 | |
4657 | 4669 | /** |
4658 | 4670 | * Record a stat for later output. This will only currently output in the admin_footer. |
4671 | + * @param string $group |
|
4659 | 4672 | */ |
4660 | 4673 | function stat( $group, $detail ) { |
4661 | 4674 | $this->initialize_stats(); |
@@ -4999,6 +5012,9 @@ discard block |
||
4999 | 5012 | return $url; |
5000 | 5013 | } |
5001 | 5014 | |
5015 | + /** |
|
5016 | + * @param string $actionurl |
|
5017 | + */ |
|
5002 | 5018 | public static function nonce_url_no_esc( $actionurl, $action = -1, $name = '_wpnonce' ) { |
5003 | 5019 | $actionurl = str_replace( '&', '&', $actionurl ); |
5004 | 5020 | return add_query_arg( $name, wp_create_nonce( $action ), $actionurl ); |
@@ -5538,7 +5554,6 @@ discard block |
||
5538 | 5554 | * @deprecated since 8.9.0 |
5539 | 5555 | * @see Automattic\Jetpack\Connection\Rest_Authentication::wp_rest_authentication_errors() |
5540 | 5556 | * |
5541 | - * @param WP_Error|mixed $result Error from another authentication handler, null if we should handle it, or another value if not |
|
5542 | 5557 | * @return WP_Error|boolean|null {@see WP_JSON_Server::check_authentication} |
5543 | 5558 | */ |
5544 | 5559 | public function wp_rest_authentication_errors( $value ) { |
@@ -5631,6 +5646,7 @@ discard block |
||
5631 | 5646 | * @param string $key |
5632 | 5647 | * @param string $value |
5633 | 5648 | * @param bool $restate private |
5649 | + * @return string |
|
5634 | 5650 | */ |
5635 | 5651 | public static function state( $key = null, $value = null, $restate = false ) { |
5636 | 5652 | static $state = array(); |
@@ -5712,6 +5728,9 @@ discard block |
||
5712 | 5728 | return true; |
5713 | 5729 | } |
5714 | 5730 | |
5731 | + /** |
|
5732 | + * @param string $file |
|
5733 | + */ |
|
5715 | 5734 | public static function check_privacy( $file ) { |
5716 | 5735 | static $is_site_publicly_accessible = null; |
5717 | 5736 | |
@@ -6285,9 +6304,7 @@ discard block |
||
6285 | 6304 | * |
6286 | 6305 | * Attached to `style_loader_src` filter. |
6287 | 6306 | * |
6288 | - * @param string $tag The tag that would link to the external asset. |
|
6289 | 6307 | * @param string $handle The registered handle of the script in question. |
6290 | - * @param string $href The url of the asset in question. |
|
6291 | 6308 | */ |
6292 | 6309 | public static function set_suffix_on_min( $src, $handle ) { |
6293 | 6310 | if ( false === strpos( $src, '.min.css' ) ) { |
@@ -6663,8 +6680,8 @@ discard block |
||
6663 | 6680 | * - Absolute URLs `http://domain.com/feh.png` |
6664 | 6681 | * - Domain root relative URLs `/feh.png` |
6665 | 6682 | * |
6666 | - * @param $css string: The raw CSS -- should be read in directly from the file. |
|
6667 | - * @param $css_file_url : The URL that the file can be accessed at, for calculating paths from. |
|
6683 | + * @param string $css string: The raw CSS -- should be read in directly from the file. |
|
6684 | + * @param string $css_file_url : The URL that the file can be accessed at, for calculating paths from. |
|
6668 | 6685 | * |
6669 | 6686 | * @return mixed|string |
6670 | 6687 | */ |
@@ -6966,7 +6983,6 @@ discard block |
||
6966 | 6983 | } |
6967 | 6984 | |
6968 | 6985 | /** |
6969 | - * @param mixed $result Value for the user's option |
|
6970 | 6986 | * @return mixed |
6971 | 6987 | */ |
6972 | 6988 | function get_user_option_meta_box_order_dashboard( $sorted ) { |
@@ -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( |
@@ -165,7 +165,7 @@ |
||
165 | 165 | /** |
166 | 166 | * Set the timestamp. |
167 | 167 | * |
168 | - * @param DateTime|string $timestamp Timestamp to set. |
|
168 | + * @param string $timestamp Timestamp to set. |
|
169 | 169 | * @returns $this |
170 | 170 | * @throws InvalidArgumentException If an argument is invalid. |
171 | 171 | */ |
@@ -89,6 +89,7 @@ |
||
89 | 89 | * |
90 | 90 | * @param string $haystack String to split. |
91 | 91 | * @param string[] ...$needles Strings to split on. Earliest match in $haystack wins. |
92 | + * @param string $needles |
|
92 | 93 | * @return string[] Two elements: The part before $needles and the part after, both trimmed. |
93 | 94 | */ |
94 | 95 | private function split( $haystack, ...$needles ) { |
@@ -43,6 +43,7 @@ |
||
43 | 43 | * @param String $action The action name. |
44 | 44 | * @param Integer|bool $user_id The user identifier. Defaults to `false`. |
45 | 45 | * @param Integer $exp Expiration time in seconds. |
46 | + * @return string|boolean |
|
46 | 47 | */ |
47 | 48 | public function generate( $action, $user_id = false, $exp = 600 ) { |
48 | 49 | if ( false === $user_id ) { |
@@ -138,7 +138,7 @@ |
||
138 | 138 | * Extract the index and count from a prerelease string. |
139 | 139 | * |
140 | 140 | * @param string|null $s String. |
141 | - * @return array Two elements: index and count. |
|
141 | + * @return integer[] Two elements: index and count. |
|
142 | 142 | * @throws InvalidArgumentException If the string is invalid. |
143 | 143 | */ |
144 | 144 | private function parsePrerelease( $s ) { |