@@ -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 ) { |
@@ -729,6 +729,7 @@ |
||
729 | 729 | * |
730 | 730 | * @param string $branch - Branch that's ready for update. |
731 | 731 | * @param string $section - What kind of branch we're updated (master, rc, pr). |
732 | + * @return string |
|
732 | 733 | */ |
733 | 734 | public static function update_action_url( $branch, $section ) { |
734 | 735 | $query = array( |
@@ -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 | /* |
@@ -168,7 +168,7 @@ |
||
168 | 168 | /** |
169 | 169 | * Checks to see whether or not the root package is the one that required the autoloader. |
170 | 170 | * |
171 | - * @return bool |
|
171 | + * @return null|boolean |
|
172 | 172 | */ |
173 | 173 | private function isRequiredByRoot() { |
174 | 174 | $package = $this->composer->getPackage(); |
@@ -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 | */ |
@@ -979,7 +979,7 @@ discard block |
||
979 | 979 | * This is ported over from the manage module, which has been deprecated and baked in here. |
980 | 980 | * |
981 | 981 | * @param $domains |
982 | - * @return array |
|
982 | + * @return string[] |
|
983 | 983 | */ |
984 | 984 | function allow_wpcom_domain( $domains ) { |
985 | 985 | if ( empty( $domains ) ) { |
@@ -1380,7 +1380,7 @@ discard block |
||
1380 | 1380 | /** |
1381 | 1381 | * Does the network allow admins to add new users. |
1382 | 1382 | * |
1383 | - * @return boolian |
|
1383 | + * @return boolean |
|
1384 | 1384 | */ |
1385 | 1385 | static function network_add_new_users( $option = null ) { |
1386 | 1386 | return (bool) get_site_option( 'add_new_users' ); |
@@ -1490,7 +1490,7 @@ discard block |
||
1490 | 1490 | * |
1491 | 1491 | * @param bool $option |
1492 | 1492 | * |
1493 | - * @return boolean |
|
1493 | + * @return string |
|
1494 | 1494 | */ |
1495 | 1495 | public function is_main_network_option( $option ) { |
1496 | 1496 | // return '1' or '' |
@@ -1501,7 +1501,7 @@ discard block |
||
1501 | 1501 | * Return true if we are with multi-site or multi-network false if we are dealing with single site. |
1502 | 1502 | * |
1503 | 1503 | * @param string $option |
1504 | - * @return boolean |
|
1504 | + * @return string |
|
1505 | 1505 | */ |
1506 | 1506 | public function is_multisite( $option ) { |
1507 | 1507 | return (string) (bool) is_multisite(); |
@@ -1564,7 +1564,7 @@ discard block |
||
1564 | 1564 | /** |
1565 | 1565 | * Returns true if the site has file write access false otherwise. |
1566 | 1566 | * |
1567 | - * @return string ( '1' | '0' ) |
|
1567 | + * @return integer ( '1' | '0' ) |
|
1568 | 1568 | **/ |
1569 | 1569 | public static function file_system_write_access() { |
1570 | 1570 | if ( ! function_exists( 'get_filesystem_method' ) ) { |
@@ -2272,7 +2272,7 @@ discard block |
||
2272 | 2272 | * @param int $user_id The user id. |
2273 | 2273 | * @param string $token The user token. |
2274 | 2274 | * @param bool $is_master_user Whether the user is the master user. |
2275 | - * @return bool |
|
2275 | + * @return boolean|null |
|
2276 | 2276 | */ |
2277 | 2277 | public static function update_user_token( $user_id, $token, $is_master_user ) { |
2278 | 2278 | _deprecated_function( __METHOD__, 'jetpack-8.0', 'Automattic\\Jetpack\\Connection\\Utils::update_user_token' ); |
@@ -2755,7 +2755,7 @@ discard block |
||
2755 | 2755 | * |
2756 | 2756 | * @param string $tag Tag as it appears in each module heading. |
2757 | 2757 | * |
2758 | - * @return mixed |
|
2758 | + * @return string |
|
2759 | 2759 | */ |
2760 | 2760 | public static function translate_module_tag( $tag ) { |
2761 | 2761 | return jetpack_get_module_i18n_tag( $tag ); |
@@ -2870,8 +2870,8 @@ discard block |
||
2870 | 2870 | * Rewrites ABSPATH (eg `/home/jetpack/wordpress/`) to ABSPATH, and if WP_CONTENT_DIR |
2871 | 2871 | * is located outside of ABSPATH, rewrites that to WP_CONTENT_DIR. |
2872 | 2872 | * |
2873 | - * @param $string |
|
2874 | - * @return mixed |
|
2873 | + * @param string $string |
|
2874 | + * @return string|null |
|
2875 | 2875 | */ |
2876 | 2876 | public static function alias_directories( $string ) { |
2877 | 2877 | // ABSPATH has a trailing slash. |
@@ -2882,6 +2882,11 @@ discard block |
||
2882 | 2882 | return $string; |
2883 | 2883 | } |
2884 | 2884 | |
2885 | + /** |
|
2886 | + * @param boolean $redirect |
|
2887 | + * @param boolean $send_state_messages |
|
2888 | + * @param boolean $requires_user_connection |
|
2889 | + */ |
|
2885 | 2890 | public static function activate_default_modules( |
2886 | 2891 | $min_version = false, |
2887 | 2892 | $max_version = false, |
@@ -3171,6 +3176,9 @@ discard block |
||
3171 | 3176 | return self::update_active_modules( $new ); |
3172 | 3177 | } |
3173 | 3178 | |
3179 | + /** |
|
3180 | + * @param string $module |
|
3181 | + */ |
|
3174 | 3182 | public static function enable_module_configurable( $module ) { |
3175 | 3183 | $module = self::get_module_slug( $module ); |
3176 | 3184 | add_filter( 'jetpack_module_configurable_' . $module, '__return_true' ); |
@@ -3199,6 +3207,10 @@ discard block |
||
3199 | 3207 | } |
3200 | 3208 | |
3201 | 3209 | /* Installation */ |
3210 | + |
|
3211 | + /** |
|
3212 | + * @param string $message |
|
3213 | + */ |
|
3202 | 3214 | public static function bail_on_activation( $message, $deactivate = true ) { |
3203 | 3215 | ?> |
3204 | 3216 | <!doctype html> |
@@ -3244,6 +3256,7 @@ discard block |
||
3244 | 3256 | * Attached to activate_{ plugin_basename( __FILES__ ) } by register_activation_hook() |
3245 | 3257 | * |
3246 | 3258 | * @static |
3259 | + * @param boolean $network_wide |
|
3247 | 3260 | */ |
3248 | 3261 | public static function plugin_activation( $network_wide ) { |
3249 | 3262 | Jetpack_Options::update_option( 'activated', 1 ); |
@@ -3965,7 +3978,7 @@ discard block |
||
3965 | 3978 | * Add help to the Jetpack page |
3966 | 3979 | * |
3967 | 3980 | * @since Jetpack (1.2.3) |
3968 | - * @return false if not the Jetpack page |
|
3981 | + * @return false|null if not the Jetpack page |
|
3969 | 3982 | */ |
3970 | 3983 | function admin_help() { |
3971 | 3984 | $current_screen = get_current_screen(); |
@@ -4706,6 +4719,7 @@ discard block |
||
4706 | 4719 | |
4707 | 4720 | /** |
4708 | 4721 | * Record a stat for later output. This will only currently output in the admin_footer. |
4722 | + * @param string $group |
|
4709 | 4723 | */ |
4710 | 4724 | function stat( $group, $detail ) { |
4711 | 4725 | $this->initialize_stats(); |
@@ -5140,6 +5154,9 @@ discard block |
||
5140 | 5154 | return $url; |
5141 | 5155 | } |
5142 | 5156 | |
5157 | + /** |
|
5158 | + * @param string $actionurl |
|
5159 | + */ |
|
5143 | 5160 | public static function nonce_url_no_esc( $actionurl, $action = -1, $name = '_wpnonce' ) { |
5144 | 5161 | $actionurl = str_replace( '&', '&', $actionurl ); |
5145 | 5162 | return add_query_arg( $name, wp_create_nonce( $action ), $actionurl ); |
@@ -5430,12 +5447,15 @@ discard block |
||
5430 | 5447 | * @param String $action The action name. |
5431 | 5448 | * @param Integer $user_id The user identifier. |
5432 | 5449 | * @param Integer $exp Expiration time in seconds. |
5433 | - * @return array |
|
5450 | + * @return boolean |
|
5434 | 5451 | */ |
5435 | 5452 | public static function generate_secrets( $action, $user_id = false, $exp = 600 ) { |
5436 | 5453 | return self::connection()->generate_secrets( $action, $user_id, $exp ); |
5437 | 5454 | } |
5438 | 5455 | |
5456 | + /** |
|
5457 | + * @param string $action |
|
5458 | + */ |
|
5439 | 5459 | public static function get_secrets( $action, $user_id ) { |
5440 | 5460 | $secrets = self::connection()->get_secrets( $action, $user_id ); |
5441 | 5461 | |
@@ -5686,7 +5706,6 @@ discard block |
||
5686 | 5706 | * @deprecated since 8.9.0 |
5687 | 5707 | * @see Automattic\Jetpack\Connection\Rest_Authentication::wp_rest_authentication_errors() |
5688 | 5708 | * |
5689 | - * @param WP_Error|mixed $result Error from another authentication handler, null if we should handle it, or another value if not |
|
5690 | 5709 | * @return WP_Error|boolean|null {@see WP_JSON_Server::check_authentication} |
5691 | 5710 | */ |
5692 | 5711 | public function wp_rest_authentication_errors( $value ) { |
@@ -5779,6 +5798,7 @@ discard block |
||
5779 | 5798 | * @param string $key |
5780 | 5799 | * @param string $value |
5781 | 5800 | * @param bool $restate private |
5801 | + * @return string |
|
5782 | 5802 | */ |
5783 | 5803 | public static function state( $key = null, $value = null, $restate = false ) { |
5784 | 5804 | static $state = array(); |
@@ -5860,6 +5880,9 @@ discard block |
||
5860 | 5880 | return true; |
5861 | 5881 | } |
5862 | 5882 | |
5883 | + /** |
|
5884 | + * @param string $file |
|
5885 | + */ |
|
5863 | 5886 | public static function check_privacy( $file ) { |
5864 | 5887 | static $is_site_publicly_accessible = null; |
5865 | 5888 | |
@@ -6432,9 +6455,7 @@ discard block |
||
6432 | 6455 | * |
6433 | 6456 | * Attached to `style_loader_src` filter. |
6434 | 6457 | * |
6435 | - * @param string $tag The tag that would link to the external asset. |
|
6436 | 6458 | * @param string $handle The registered handle of the script in question. |
6437 | - * @param string $href The url of the asset in question. |
|
6438 | 6459 | */ |
6439 | 6460 | public static function set_suffix_on_min( $src, $handle ) { |
6440 | 6461 | if ( false === strpos( $src, '.min.css' ) ) { |
@@ -6810,8 +6831,8 @@ discard block |
||
6810 | 6831 | * - Absolute URLs `http://domain.com/feh.png` |
6811 | 6832 | * - Domain root relative URLs `/feh.png` |
6812 | 6833 | * |
6813 | - * @param $css string: The raw CSS -- should be read in directly from the file. |
|
6814 | - * @param $css_file_url : The URL that the file can be accessed at, for calculating paths from. |
|
6834 | + * @param string $css string: The raw CSS -- should be read in directly from the file. |
|
6835 | + * @param string $css_file_url : The URL that the file can be accessed at, for calculating paths from. |
|
6815 | 6836 | * |
6816 | 6837 | * @return mixed|string |
6817 | 6838 | */ |
@@ -7113,7 +7134,6 @@ discard block |
||
7113 | 7134 | } |
7114 | 7135 | |
7115 | 7136 | /** |
7116 | - * @param mixed $result Value for the user's option |
|
7117 | 7137 | * @return mixed |
7118 | 7138 | */ |
7119 | 7139 | function get_user_option_meta_box_order_dashboard( $sorted ) { |