@@ -235,7 +235,7 @@ |
||
235 | 235 | * @param string $name Template name, available in `./templates` folder. |
236 | 236 | * @param array $template_props Template properties. Optional. |
237 | 237 | * @param bool $print Render template. True as default. |
238 | - * @return false|string HTML markup or false. |
|
238 | + * @return string|null HTML markup or false. |
|
239 | 239 | */ |
240 | 240 | function render( $name, $template_props = array(), $print = true ) { |
241 | 241 | if ( ! strpos( $name, '.php' ) ) { |
@@ -290,7 +290,7 @@ discard block |
||
290 | 290 | * Get Stats Options. |
291 | 291 | * |
292 | 292 | * @access public |
293 | - * @param mixed $option Option. |
|
293 | + * @param string $option Option. |
|
294 | 294 | * @return mixed|null. |
295 | 295 | */ |
296 | 296 | function stats_get_option( $option ) { |
@@ -744,7 +744,7 @@ discard block |
||
744 | 744 | * Stats Convert Chart URLs. |
745 | 745 | * |
746 | 746 | * @access public |
747 | - * @param mixed $html HTML. |
|
747 | + * @param string $html HTML. |
|
748 | 748 | * @return string |
749 | 749 | */ |
750 | 750 | function stats_convert_chart_urls( $html ) { |
@@ -1414,7 +1414,7 @@ discard block |
||
1414 | 1414 | * |
1415 | 1415 | * @access public |
1416 | 1416 | * @param mixed $get Get. |
1417 | - * @param mixed $url URL. |
|
1417 | + * @param string $url URL. |
|
1418 | 1418 | * @return void |
1419 | 1419 | */ |
1420 | 1420 | function stats_print_wp_remote_error( $get, $url ) { |
@@ -1556,7 +1556,7 @@ discard block |
||
1556 | 1556 | * Stats get remote CSV. |
1557 | 1557 | * |
1558 | 1558 | * @access public |
1559 | - * @param mixed $url URL. |
|
1559 | + * @param string $url URL. |
|
1560 | 1560 | * @return array |
1561 | 1561 | */ |
1562 | 1562 | function stats_get_remote_csv( $url ) { |
@@ -55,7 +55,7 @@ |
||
55 | 55 | * |
56 | 56 | * @since 5.6.0 |
57 | 57 | * |
58 | - * @return object The class instance. |
|
58 | + * @return Jetpack_Lazy_Images The class instance. |
|
59 | 59 | */ |
60 | 60 | public static function instance() { |
61 | 61 | if ( is_null( self::$instance ) ) { |
@@ -313,7 +313,7 @@ discard block |
||
313 | 313 | /** |
314 | 314 | * Verifies the signature of the current request. |
315 | 315 | * |
316 | - * @return false|array |
|
316 | + * @return boolean |
|
317 | 317 | */ |
318 | 318 | public function verify_xml_rpc_signature() { |
319 | 319 | if ( is_null( $this->xmlrpc_verification ) ) { |
@@ -1286,6 +1286,7 @@ discard block |
||
1286 | 1286 | * @param String $action The action name. |
1287 | 1287 | * @param Integer $user_id The user identifier. |
1288 | 1288 | * @param Integer $exp Expiration time in seconds. |
1289 | + * @return string |
|
1289 | 1290 | */ |
1290 | 1291 | public function generate_secrets( $action, $user_id = false, $exp = 600 ) { |
1291 | 1292 | if ( false === $user_id ) { |
@@ -2242,7 +2243,7 @@ discard block |
||
2242 | 2243 | * |
2243 | 2244 | * @param int|false $user_id false: Return the Blog Token. int: Return that user's User Token. |
2244 | 2245 | * @param string|false $token_key If provided, check that the token matches the provided input. |
2245 | - * @param bool|true $suppress_errors If true, return a falsy value when the token isn't found; When false, return a descriptive WP_Error when the token isn't found. |
|
2246 | + * @param boolean $suppress_errors If true, return a falsy value when the token isn't found; When false, return a descriptive WP_Error when the token isn't found. |
|
2246 | 2247 | * |
2247 | 2248 | * @return object|false |
2248 | 2249 | */ |
@@ -2626,7 +2627,7 @@ discard block |
||
2626 | 2627 | * Fetches a signed token. |
2627 | 2628 | * |
2628 | 2629 | * @param object $token the token. |
2629 | - * @return WP_Error|string a signed token |
|
2630 | + * @return string a signed token |
|
2630 | 2631 | */ |
2631 | 2632 | public function get_signed_token( $token ) { |
2632 | 2633 | if ( ! isset( $token->secret ) || empty( $token->secret ) ) { |
@@ -583,7 +583,7 @@ discard block |
||
583 | 583 | * Only enqueue block assets when needed. |
584 | 584 | * |
585 | 585 | * @param string $type Slug of the block. |
586 | - * @param array $script_dependencies Script dependencies. Will be merged with automatically |
|
586 | + * @param string[] $script_dependencies Script dependencies. Will be merged with automatically |
|
587 | 587 | * detected script dependencies from the webpack build. |
588 | 588 | * |
589 | 589 | * @return void |
@@ -837,7 +837,7 @@ discard block |
||
837 | 837 | * |
838 | 838 | * @param string $slug Block slug. |
839 | 839 | * @param array $attr Block attributes. |
840 | - * @param array $extra Potential extra classes you may want to provide. |
|
840 | + * @param string[] $extra Potential extra classes you may want to provide. |
|
841 | 841 | * |
842 | 842 | * @return string $classes List of CSS classes for a block. |
843 | 843 | */ |
@@ -934,10 +934,10 @@ discard block |
||
934 | 934 | * @since 8.3.0 |
935 | 935 | * |
936 | 936 | * @param string $url URL saved as an attribute in block. |
937 | - * @param array $allowed Array of allowed hosts for that block, or regexes to check against. |
|
937 | + * @param string[] $allowed Array of allowed hosts for that block, or regexes to check against. |
|
938 | 938 | * @param bool $is_regex Array of regexes matching the URL that could be used in block. |
939 | 939 | * |
940 | - * @return bool|string |
|
940 | + * @return false|string |
|
941 | 941 | */ |
942 | 942 | public static function validate_block_embed_url( $url, $allowed = array(), $is_regex = false ) { |
943 | 943 | if ( |
@@ -325,7 +325,7 @@ |
||
325 | 325 | * @access protected |
326 | 326 | * |
327 | 327 | * @param string $status Comment status. |
328 | - * @return string|bool New comment_approved value, false if the status doesn't affect it. |
|
328 | + * @return string|false New comment_approved value, false if the status doesn't affect it. |
|
329 | 329 | */ |
330 | 330 | protected function comment_status_to_approval_value( $status ) { |
331 | 331 | switch ( (string) $status ) { |
@@ -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> |
@@ -3884,7 +3895,7 @@ discard block |
||
3884 | 3895 | * Add help to the Jetpack page |
3885 | 3896 | * |
3886 | 3897 | * @since Jetpack (1.2.3) |
3887 | - * @return false if not the Jetpack page |
|
3898 | + * @return false|null if not the Jetpack page |
|
3888 | 3899 | */ |
3889 | 3900 | function admin_help() { |
3890 | 3901 | $current_screen = get_current_screen(); |
@@ -4588,6 +4599,7 @@ discard block |
||
4588 | 4599 | |
4589 | 4600 | /** |
4590 | 4601 | * Record a stat for later output. This will only currently output in the admin_footer. |
4602 | + * @param string $group |
|
4591 | 4603 | */ |
4592 | 4604 | function stat( $group, $detail ) { |
4593 | 4605 | $this->initialize_stats(); |
@@ -5001,6 +5013,9 @@ discard block |
||
5001 | 5013 | return $url; |
5002 | 5014 | } |
5003 | 5015 | |
5016 | + /** |
|
5017 | + * @param string $actionurl |
|
5018 | + */ |
|
5004 | 5019 | public static function nonce_url_no_esc( $actionurl, $action = -1, $name = '_wpnonce' ) { |
5005 | 5020 | $actionurl = str_replace( '&', '&', $actionurl ); |
5006 | 5021 | return add_query_arg( $name, wp_create_nonce( $action ), $actionurl ); |
@@ -5291,7 +5306,7 @@ discard block |
||
5291 | 5306 | * @param String $action The action name. |
5292 | 5307 | * @param Integer $user_id The user identifier. |
5293 | 5308 | * @param Integer $exp Expiration time in seconds. |
5294 | - * @return array |
|
5309 | + * @return boolean |
|
5295 | 5310 | */ |
5296 | 5311 | public static function generate_secrets( $action, $user_id = false, $exp = 600 ) { |
5297 | 5312 | return self::connection()->generate_secrets( $action, $user_id, $exp ); |
@@ -5547,7 +5562,6 @@ discard block |
||
5547 | 5562 | * @deprecated since 8.9.0 |
5548 | 5563 | * @see Automattic\Jetpack\Connection\Rest_Authentication::wp_rest_authentication_errors() |
5549 | 5564 | * |
5550 | - * @param WP_Error|mixed $result Error from another authentication handler, null if we should handle it, or another value if not |
|
5551 | 5565 | * @return WP_Error|boolean|null {@see WP_JSON_Server::check_authentication} |
5552 | 5566 | */ |
5553 | 5567 | public function wp_rest_authentication_errors( $value ) { |
@@ -5640,6 +5654,7 @@ discard block |
||
5640 | 5654 | * @param string $key |
5641 | 5655 | * @param string $value |
5642 | 5656 | * @param bool $restate private |
5657 | + * @return string |
|
5643 | 5658 | */ |
5644 | 5659 | public static function state( $key = null, $value = null, $restate = false ) { |
5645 | 5660 | static $state = array(); |
@@ -5721,6 +5736,9 @@ discard block |
||
5721 | 5736 | return true; |
5722 | 5737 | } |
5723 | 5738 | |
5739 | + /** |
|
5740 | + * @param string $file |
|
5741 | + */ |
|
5724 | 5742 | public static function check_privacy( $file ) { |
5725 | 5743 | static $is_site_publicly_accessible = null; |
5726 | 5744 | |
@@ -6293,9 +6311,7 @@ discard block |
||
6293 | 6311 | * |
6294 | 6312 | * Attached to `style_loader_src` filter. |
6295 | 6313 | * |
6296 | - * @param string $tag The tag that would link to the external asset. |
|
6297 | 6314 | * @param string $handle The registered handle of the script in question. |
6298 | - * @param string $href The url of the asset in question. |
|
6299 | 6315 | */ |
6300 | 6316 | public static function set_suffix_on_min( $src, $handle ) { |
6301 | 6317 | if ( false === strpos( $src, '.min.css' ) ) { |
@@ -6671,8 +6687,8 @@ discard block |
||
6671 | 6687 | * - Absolute URLs `http://domain.com/feh.png` |
6672 | 6688 | * - Domain root relative URLs `/feh.png` |
6673 | 6689 | * |
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. |
|
6690 | + * @param string $css string: The raw CSS -- should be read in directly from the file. |
|
6691 | + * @param string $css_file_url : The URL that the file can be accessed at, for calculating paths from. |
|
6676 | 6692 | * |
6677 | 6693 | * @return mixed|string |
6678 | 6694 | */ |
@@ -6971,7 +6987,6 @@ discard block |
||
6971 | 6987 | } |
6972 | 6988 | |
6973 | 6989 | /** |
6974 | - * @param mixed $result Value for the user's option |
|
6975 | 6990 | * @return mixed |
6976 | 6991 | */ |
6977 | 6992 | function get_user_option_meta_box_order_dashboard( $sorted ) { |
@@ -66,7 +66,7 @@ |
||
66 | 66 | * Add a callback for WooCommerce product rendering in infinite scroll. |
67 | 67 | * |
68 | 68 | * @param array $callbacks Array of render callpacks for IS. |
69 | - * @return array |
|
69 | + * @return string[] |
|
70 | 70 | */ |
71 | 71 | function jetpack_woocommerce_infinite_scroll_render_callback( $callbacks ) { |
72 | 72 | $callbacks[] = 'jetpack_woocommerce_infinite_scroll_render'; |
@@ -224,7 +224,7 @@ discard block |
||
224 | 224 | * |
225 | 225 | * @param string $table Table name to validate. |
226 | 226 | * |
227 | - * @return mixed|string |
|
227 | + * @return string |
|
228 | 228 | * @throws Exception Throw an exception on validation failure. |
229 | 229 | */ |
230 | 230 | private function validate_table_name( $table ) { |
@@ -482,7 +482,7 @@ discard block |
||
482 | 482 | * @param int|null $range_to The end of the range. |
483 | 483 | * @param int|null $limit How many values to return. |
484 | 484 | * |
485 | - * @return array|object|void |
|
485 | + * @return boolean |
|
486 | 486 | * @throws Exception Throws an exception if validation fails on the internal function calls. |
487 | 487 | */ |
488 | 488 | public function get_range_edges( $range_from = null, $range_to = null, $limit = null ) { |