@@ -16,6 +16,9 @@ discard block |
||
| 16 | 16 | public $context; |
| 17 | 17 | public $site; |
| 18 | 18 | |
| 19 | + /** |
|
| 20 | + * @param Jetpack_Site $site |
|
| 21 | + */ |
|
| 19 | 22 | function __construct( $site, $post, $context ) { |
| 20 | 23 | $this->post = $post; |
| 21 | 24 | $this->context = $context; |
@@ -487,6 +490,10 @@ discard block |
||
| 487 | 490 | return $suggestions; |
| 488 | 491 | } |
| 489 | 492 | |
| 493 | + /** |
|
| 494 | + * @param string $taxonomy_type |
|
| 495 | + * @param string $context |
|
| 496 | + */ |
|
| 490 | 497 | private function format_taxonomy( $taxonomy, $taxonomy_type, $context ) { |
| 491 | 498 | // Permissions |
| 492 | 499 | switch ( $context ) { |
@@ -26,7 +26,6 @@ discard block |
||
| 26 | 26 | * |
| 27 | 27 | * Used to construct meta links in API responses |
| 28 | 28 | * |
| 29 | - * @param mixed $args Optional arguments to be appended to URL |
|
| 30 | 29 | * @return string Endpoint URL |
| 31 | 30 | **/ |
| 32 | 31 | function get_link() { |
@@ -117,7 +116,7 @@ discard block |
||
| 117 | 116 | * This method is used in get_link() to construct meta links for API responses. |
| 118 | 117 | * |
| 119 | 118 | * @param $template_path The generic endpoint path, e.g. /sites/%s |
| 120 | - * @param $path string The current endpoint path, relative to the version, e.g. /sites/12345 |
|
| 119 | + * @param string $path string The current endpoint path, relative to the version, e.g. /sites/12345 |
|
| 121 | 120 | * @param $method string Request method used to access the endpoint path |
| 122 | 121 | * @return string The current version, or otherwise the maximum version available |
| 123 | 122 | */ |
@@ -1341,6 +1341,7 @@ discard block |
||
| 1341 | 1341 | * timezone set in the options table for the blog or the GMT offset. |
| 1342 | 1342 | * |
| 1343 | 1343 | * @param datetime string |
| 1344 | + * @param string $date_string |
|
| 1344 | 1345 | * |
| 1345 | 1346 | * @return array( $local_time_string, $gmt_time_string ) |
| 1346 | 1347 | */ |
@@ -1458,6 +1459,10 @@ discard block |
||
| 1458 | 1459 | do_action( 'restapi_theme_init' ); |
| 1459 | 1460 | } |
| 1460 | 1461 | |
| 1462 | + /** |
|
| 1463 | + * @param string $from_hook |
|
| 1464 | + * @param string $to_hook |
|
| 1465 | + */ |
|
| 1461 | 1466 | function copy_hooks( $from_hook, $to_hook, $base_paths ) { |
| 1462 | 1467 | global $wp_filter; |
| 1463 | 1468 | foreach ( $wp_filter as $hook => $actions ) { |
@@ -23,6 +23,9 @@ |
||
| 23 | 23 | public $blog_id; |
| 24 | 24 | public $platform; |
| 25 | 25 | |
| 26 | + /** |
|
| 27 | + * @param WPORG_Platform $platform |
|
| 28 | + */ |
|
| 26 | 29 | public function __construct( $blog_id, $platform ) { |
| 27 | 30 | $this->blog_id = $blog_id; |
| 28 | 31 | $this->platform = $platform; |
@@ -120,6 +120,9 @@ discard block |
||
| 120 | 120 | return $response; |
| 121 | 121 | } |
| 122 | 122 | |
| 123 | + /** |
|
| 124 | + * @param string $field |
|
| 125 | + */ |
|
| 123 | 126 | protected function get_sal_post_by( $field, $field_value, $context ) { |
| 124 | 127 | global $blog_id; |
| 125 | 128 | |
@@ -132,6 +135,9 @@ discard block |
||
| 132 | 135 | return $post; |
| 133 | 136 | } |
| 134 | 137 | |
| 138 | + /** |
|
| 139 | + * @param string $context |
|
| 140 | + */ |
|
| 135 | 141 | private function render_response_keys( $post, $context, $keys ) { |
| 136 | 142 | foreach ( $keys as $key ) { |
| 137 | 143 | switch ( $key ) { |
@@ -181,7 +181,7 @@ |
||
| 181 | 181 | /** |
| 182 | 182 | * Backend function to abstract the xmlrpc function calls to wpcom. |
| 183 | 183 | * |
| 184 | - * @param $endpoint |
|
| 184 | + * @param string $endpoint |
|
| 185 | 185 | * @param $error_message |
| 186 | 186 | */ |
| 187 | 187 | function __process_ajax_proxy_request( $endpoint, $error_message ) { |
@@ -1940,7 +1940,7 @@ |
||
| 1940 | 1940 | * |
| 1941 | 1941 | * @param string $route Regular expression for the endpoint with the module slug to return. |
| 1942 | 1942 | * |
| 1943 | - * @return array |
|
| 1943 | + * @return string |
|
| 1944 | 1944 | */ |
| 1945 | 1945 | public static function get_module_requested( $route ) { |
| 1946 | 1946 | |
@@ -1018,7 +1018,7 @@ discard block |
||
| 1018 | 1018 | } |
| 1019 | 1019 | /** |
| 1020 | 1020 | * Does the network allow admins to add new users. |
| 1021 | - * @return boolian |
|
| 1021 | + * @return boolean |
|
| 1022 | 1022 | */ |
| 1023 | 1023 | static function network_add_new_users( $option = null ) { |
| 1024 | 1024 | return (bool) get_site_option( 'add_new_users' ); |
@@ -1066,7 +1066,7 @@ discard block |
||
| 1066 | 1066 | * database which could be set to anything as opposed to what this function returns. |
| 1067 | 1067 | * @param bool $option |
| 1068 | 1068 | * |
| 1069 | - * @return boolean |
|
| 1069 | + * @return string |
|
| 1070 | 1070 | */ |
| 1071 | 1071 | public function is_main_network_option( $option ) { |
| 1072 | 1072 | // return '1' or '' |
@@ -1077,7 +1077,7 @@ discard block |
||
| 1077 | 1077 | * Return true if we are with multi-site or multi-network false if we are dealing with single site. |
| 1078 | 1078 | * |
| 1079 | 1079 | * @param string $option |
| 1080 | - * @return boolean |
|
| 1080 | + * @return string |
|
| 1081 | 1081 | */ |
| 1082 | 1082 | public function is_multisite( $option ) { |
| 1083 | 1083 | return (string) (bool) is_multisite(); |
@@ -1175,7 +1175,7 @@ discard block |
||
| 1175 | 1175 | |
| 1176 | 1176 | /** |
| 1177 | 1177 | * Returns true if the site has file write access false otherwise. |
| 1178 | - * @return string ( '1' | '0' ) |
|
| 1178 | + * @return integer ( '1' | '0' ) |
|
| 1179 | 1179 | **/ |
| 1180 | 1180 | public static function file_system_write_access() { |
| 1181 | 1181 | if ( ! function_exists( 'get_filesystem_method' ) ) { |
@@ -1985,7 +1985,7 @@ discard block |
||
| 1985 | 1985 | * Returns the requested option. Looks in jetpack_options or jetpack_$name as appropriate. |
| 1986 | 1986 | * |
| 1987 | 1987 | * @param string $name Option name |
| 1988 | - * @param mixed $default (optional) |
|
| 1988 | + * @param boolean $default (optional) |
|
| 1989 | 1989 | */ |
| 1990 | 1990 | public static function get_option( $name, $default = false ) { |
| 1991 | 1991 | return Jetpack_Options::get_option( $name, $default ); |
@@ -1995,6 +1995,7 @@ discard block |
||
| 1995 | 1995 | * Stores two secrets and a timestamp so WordPress.com can make a request back and verify an action |
| 1996 | 1996 | * Does some extra verification so urls (such as those to public-api, register, etc) can't just be crafted |
| 1997 | 1997 | * $name must be a registered option name. |
| 1998 | + * @param string $name |
|
| 1998 | 1999 | */ |
| 1999 | 2000 | public static function create_nonce( $name ) { |
| 2000 | 2001 | $secret = wp_generate_password( 32, false ) . ':' . wp_generate_password( 32, false ) . ':' . ( time() + 600 ); |
@@ -2052,6 +2053,7 @@ discard block |
||
| 2052 | 2053 | * @param int $user_id |
| 2053 | 2054 | * @param string $token |
| 2054 | 2055 | * return bool |
| 2056 | + * @param boolean $is_master_user |
|
| 2055 | 2057 | */ |
| 2056 | 2058 | public static function update_user_token( $user_id, $token, $is_master_user ) { |
| 2057 | 2059 | // not designed for concurrent updates |
@@ -2446,6 +2448,7 @@ discard block |
||
| 2446 | 2448 | |
| 2447 | 2449 | /** |
| 2448 | 2450 | * Like core's get_file_data implementation, but caches the result. |
| 2451 | + * @param string $file |
|
| 2449 | 2452 | */ |
| 2450 | 2453 | public static function get_file_data( $file, $headers ) { |
| 2451 | 2454 | //Get just the filename from $file (i.e. exclude full path) so that a consistent hash is generated |
@@ -2474,7 +2477,7 @@ discard block |
||
| 2474 | 2477 | * |
| 2475 | 2478 | * @param string $tag Tag as it appears in each module heading. |
| 2476 | 2479 | * |
| 2477 | - * @return mixed |
|
| 2480 | + * @return string |
|
| 2478 | 2481 | */ |
| 2479 | 2482 | public static function translate_module_tag( $tag ) { |
| 2480 | 2483 | return jetpack_get_module_i18n_tag( $tag ); |
@@ -2792,6 +2795,9 @@ discard block |
||
| 2792 | 2795 | $this->sync->sync_all_module_options( $module ); |
| 2793 | 2796 | } |
| 2794 | 2797 | |
| 2798 | + /** |
|
| 2799 | + * @return string |
|
| 2800 | + */ |
|
| 2795 | 2801 | public static function deactivate_module( $module ) { |
| 2796 | 2802 | /** |
| 2797 | 2803 | * Fires when a module is deactivated. |
@@ -2830,6 +2836,9 @@ discard block |
||
| 2830 | 2836 | return Jetpack_Options::update_option( 'active_modules', array_unique( $new ) ); |
| 2831 | 2837 | } |
| 2832 | 2838 | |
| 2839 | + /** |
|
| 2840 | + * @param string $module |
|
| 2841 | + */ |
|
| 2833 | 2842 | public static function enable_module_configurable( $module ) { |
| 2834 | 2843 | $module = Jetpack::get_module_slug( $module ); |
| 2835 | 2844 | add_filter( 'jetpack_module_configurable_' . $module, '__return_true' ); |
@@ -2840,21 +2849,33 @@ discard block |
||
| 2840 | 2849 | return Jetpack::admin_url( array( 'page' => 'jetpack', 'configure' => $module ) ); |
| 2841 | 2850 | } |
| 2842 | 2851 | |
| 2852 | + /** |
|
| 2853 | + * @param string $module |
|
| 2854 | + */ |
|
| 2843 | 2855 | public static function module_configuration_load( $module, $method ) { |
| 2844 | 2856 | $module = Jetpack::get_module_slug( $module ); |
| 2845 | 2857 | add_action( 'jetpack_module_configuration_load_' . $module, $method ); |
| 2846 | 2858 | } |
| 2847 | 2859 | |
| 2860 | + /** |
|
| 2861 | + * @param string $module |
|
| 2862 | + */ |
|
| 2848 | 2863 | public static function module_configuration_head( $module, $method ) { |
| 2849 | 2864 | $module = Jetpack::get_module_slug( $module ); |
| 2850 | 2865 | add_action( 'jetpack_module_configuration_head_' . $module, $method ); |
| 2851 | 2866 | } |
| 2852 | 2867 | |
| 2868 | + /** |
|
| 2869 | + * @param string $module |
|
| 2870 | + */ |
|
| 2853 | 2871 | public static function module_configuration_screen( $module, $method ) { |
| 2854 | 2872 | $module = Jetpack::get_module_slug( $module ); |
| 2855 | 2873 | add_action( 'jetpack_module_configuration_screen_' . $module, $method ); |
| 2856 | 2874 | } |
| 2857 | 2875 | |
| 2876 | + /** |
|
| 2877 | + * @param string $module |
|
| 2878 | + */ |
|
| 2858 | 2879 | public static function module_configuration_activation_screen( $module, $method ) { |
| 2859 | 2880 | $module = Jetpack::get_module_slug( $module ); |
| 2860 | 2881 | add_action( 'display_activate_module_setting_' . $module, $method ); |
@@ -2862,6 +2883,9 @@ discard block |
||
| 2862 | 2883 | |
| 2863 | 2884 | /* Installation */ |
| 2864 | 2885 | |
| 2886 | + /** |
|
| 2887 | + * @param string $message |
|
| 2888 | + */ |
|
| 2865 | 2889 | public static function bail_on_activation( $message, $deactivate = true ) { |
| 2866 | 2890 | ?> |
| 2867 | 2891 | <!doctype html> |
@@ -3475,7 +3499,7 @@ discard block |
||
| 3475 | 3499 | * Add help to the Jetpack page |
| 3476 | 3500 | * |
| 3477 | 3501 | * @since Jetpack (1.2.3) |
| 3478 | - * @return false if not the Jetpack page |
|
| 3502 | + * @return false|null if not the Jetpack page |
|
| 3479 | 3503 | */ |
| 3480 | 3504 | function admin_help() { |
| 3481 | 3505 | $current_screen = get_current_screen(); |
@@ -4793,6 +4817,7 @@ discard block |
||
| 4793 | 4817 | /** |
| 4794 | 4818 | * Returns the requested Jetpack API URL |
| 4795 | 4819 | * |
| 4820 | + * @param string $relative_url |
|
| 4796 | 4821 | * @return string |
| 4797 | 4822 | */ |
| 4798 | 4823 | public static function api_url( $relative_url ) { |
@@ -5219,6 +5244,10 @@ discard block |
||
| 5219 | 5244 | return new WP_User( $token_details['user_id'] ); |
| 5220 | 5245 | } |
| 5221 | 5246 | |
| 5247 | + /** |
|
| 5248 | + * @param integer $timestamp |
|
| 5249 | + * @param string $nonce |
|
| 5250 | + */ |
|
| 5222 | 5251 | function add_nonce( $timestamp, $nonce ) { |
| 5223 | 5252 | global $wpdb; |
| 5224 | 5253 | static $nonces_used_this_request = array(); |
@@ -5424,6 +5453,9 @@ discard block |
||
| 5424 | 5453 | Jetpack::state( null, null, true ); |
| 5425 | 5454 | } |
| 5426 | 5455 | |
| 5456 | + /** |
|
| 5457 | + * @param string $file |
|
| 5458 | + */ |
|
| 5427 | 5459 | public static function check_privacy( $file ) { |
| 5428 | 5460 | static $is_site_publicly_accessible = null; |
| 5429 | 5461 | |
@@ -5751,7 +5783,7 @@ discard block |
||
| 5751 | 5783 | /** |
| 5752 | 5784 | * Pings the WordPress.com Mirror Site for the specified options. |
| 5753 | 5785 | * |
| 5754 | - * @param string|array $option_names The option names to request from the WordPress.com Mirror Site |
|
| 5786 | + * @param string[] $option_names The option names to request from the WordPress.com Mirror Site |
|
| 5755 | 5787 | * |
| 5756 | 5788 | * @return array An associative array of the option values as stored in the WordPress.com Mirror Site |
| 5757 | 5789 | */ |
@@ -5775,7 +5807,7 @@ discard block |
||
| 5775 | 5807 | /** |
| 5776 | 5808 | * Fetch the filtered array of options that we should compare to determine an identity crisis. |
| 5777 | 5809 | * |
| 5778 | - * @return array An array of options to check. |
|
| 5810 | + * @return string[] An array of options to check. |
|
| 5779 | 5811 | */ |
| 5780 | 5812 | public static function identity_crisis_options_to_check() { |
| 5781 | 5813 | return array( |
@@ -6447,8 +6479,8 @@ discard block |
||
| 6447 | 6479 | * - Absolute URLs `http://domain.com/feh.png` |
| 6448 | 6480 | * - Domain root relative URLs `/feh.png` |
| 6449 | 6481 | * |
| 6450 | - * @param $css string: The raw CSS -- should be read in directly from the file. |
|
| 6451 | - * @param $css_file_url : The URL that the file can be accessed at, for calculating paths from. |
|
| 6482 | + * @param string $css string: The raw CSS -- should be read in directly from the file. |
|
| 6483 | + * @param string $css_file_url : The URL that the file can be accessed at, for calculating paths from. |
|
| 6452 | 6484 | * |
| 6453 | 6485 | * @return mixed|string |
| 6454 | 6486 | */ |
@@ -6756,7 +6788,7 @@ discard block |
||
| 6756 | 6788 | * |
| 6757 | 6789 | * @param string $option_name |
| 6758 | 6790 | * |
| 6759 | - * @return bool |
|
| 6791 | + * @return false|null |
|
| 6760 | 6792 | */ |
| 6761 | 6793 | public static function jumpstart_has_updated_module_option( $option_name = '' ) { |
| 6762 | 6794 | // Bail if Jump Start has already been dismissed |
@@ -6847,7 +6879,6 @@ discard block |
||
| 6847 | 6879 | } |
| 6848 | 6880 | |
| 6849 | 6881 | /** |
| 6850 | - * @param mixed $result Value for the user's option |
|
| 6851 | 6882 | * @return mixed |
| 6852 | 6883 | */ |
| 6853 | 6884 | function get_user_option_meta_box_order_dashboard( $sorted ) { |