Completed
Push — update/core-version-upgrade-ro... ( 3d6e97 )
by
unknown
102:47 queued 91:38
created
class.jetpack.php 1 patch
Doc Comments   +50 added lines, -15 removed lines patch added patch discarded remove patch
@@ -332,7 +332,7 @@  discard block
 block discarded – undo
332 332
 
333 333
 	/**
334 334
 	 * Runs after bumping version numbers up to a new version
335
-	 * @param  (string) $version    Version:timestamp
335
+	 * @param  (string) $new_version    Version:timestamp
336 336
 	 * @param  (string) $old_version Old Version:timestamp or false if not set yet.
337 337
 	 * @return null              [description]
338 338
 	 */
@@ -340,6 +340,9 @@  discard block
 block discarded – undo
340 340
 		Jetpack::clear_modules( $new_version, $old_version );
341 341
 	}
342 342
 
343
+	/**
344
+	 * @param string $old_version
345
+	 */
343 346
 	public static function clear_modules( $new_version, $old_version ) {
344 347
 		if ( did_action( 'init' ) || current_filter() == 'init' ) {
345 348
 			if ( ! $old_version ) { // For new sites
@@ -882,7 +885,7 @@  discard block
 block discarded – undo
882 885
 	}
883 886
 	/**
884 887
 	 * Does the network allow admins to add new users.
885
-	 * @return boolian
888
+	 * @return boolean
886 889
 	 */
887 890
 	static function network_add_new_users( $option = null ) {
888 891
 		return (bool) get_site_option( 'add_new_users' );
@@ -930,7 +933,7 @@  discard block
 block discarded – undo
930 933
 	 * database which could be set to anything as opposed to what this function returns.
931 934
 	 * @param  bool  $option
932 935
 	 *
933
-	 * @return boolean
936
+	 * @return string
934 937
 	 */
935 938
 	public function is_main_network_option( $option ) {
936 939
 		// return '1' or ''
@@ -941,7 +944,7 @@  discard block
 block discarded – undo
941 944
 	 * Return true if we are with multi-site or multi-network false if we are dealing with single site.
942 945
 	 *
943 946
 	 * @param  string  $option
944
-	 * @return boolean
947
+	 * @return string
945 948
 	 */
946 949
 	public function is_multisite( $option ) {
947 950
 		return (string) (bool) is_multisite();
@@ -1002,7 +1005,7 @@  discard block
 block discarded – undo
1002 1005
 
1003 1006
 	/**
1004 1007
 	 * Returns true if the site has file write access false otherwise.
1005
-	 * @return string ( '1' | '0' )
1008
+	 * @return integer ( '1' | '0' )
1006 1009
 	 **/
1007 1010
 	public static function file_system_write_access() {
1008 1011
 		if ( ! function_exists( 'get_filesystem_method' ) ) {
@@ -1548,7 +1551,7 @@  discard block
 block discarded – undo
1548 1551
 	 * Returns the requested option.  Looks in jetpack_options or jetpack_$name as appropriate.
1549 1552
  	 *
1550 1553
 	 * @param string $name    Option name
1551
-	 * @param mixed  $default (optional)
1554
+	 * @param boolean  $default (optional)
1552 1555
 	 */
1553 1556
 	public static function get_option( $name, $default = false ) {
1554 1557
 		return Jetpack_Options::get_option( $name, $default );
@@ -1558,6 +1561,7 @@  discard block
 block discarded – undo
1558 1561
 	* Stores two secrets and a timestamp so WordPress.com can make a request back and verify an action
1559 1562
 	* Does some extra verification so urls (such as those to public-api, register, etc) can't just be crafted
1560 1563
 	* $name must be a registered option name.
1564
+	* @param string $name
1561 1565
 	*/
1562 1566
 	public static function create_nonce( $name ) {
1563 1567
 		$secret = wp_generate_password( 32, false ) . ':' . wp_generate_password( 32, false ) . ':' . ( time() + 600 );
@@ -1615,6 +1619,7 @@  discard block
 block discarded – undo
1615 1619
 	 * @param int $user_id
1616 1620
 	 * @param string $token
1617 1621
 	 * return bool
1622
+	 * @param boolean $is_master_user
1618 1623
 	 */
1619 1624
 	public static function update_user_token( $user_id, $token, $is_master_user ) {
1620 1625
 		// not designed for concurrent updates
@@ -1985,6 +1990,7 @@  discard block
 block discarded – undo
1985 1990
 
1986 1991
 	/**
1987 1992
 	 * Like core's get_file_data implementation, but caches the result.
1993
+	 * @param string $file
1988 1994
 	 */
1989 1995
 	public static function get_file_data( $file, $headers ) {
1990 1996
 		//Get just the filename from $file (i.e. exclude full path) so that a consistent hash is generated
@@ -2013,7 +2019,7 @@  discard block
 block discarded – undo
2013 2019
 	 *
2014 2020
 	 * @param string $tag Tag as it appears in each module heading.
2015 2021
 	 *
2016
-	 * @return mixed
2022
+	 * @return string
2017 2023
 	 */
2018 2024
 	public static function translate_module_tag( $tag ) {
2019 2025
 		return jetpack_get_module_i18n_tag( $tag );
@@ -2327,6 +2333,9 @@  discard block
 block discarded – undo
2327 2333
 		do_action( "jetpack_activate_module_$module", $module );
2328 2334
 	}
2329 2335
 
2336
+	/**
2337
+	 * @return string
2338
+	 */
2330 2339
 	public static function deactivate_module( $module ) {
2331 2340
 		/**
2332 2341
 		 * Fires when a module is deactivated.
@@ -2376,6 +2385,9 @@  discard block
 block discarded – undo
2376 2385
 		return $success;
2377 2386
 	}
2378 2387
 
2388
+	/**
2389
+	 * @param string $module
2390
+	 */
2379 2391
 	public static function enable_module_configurable( $module ) {
2380 2392
 		$module = Jetpack::get_module_slug( $module );
2381 2393
 		add_filter( 'jetpack_module_configurable_' . $module, '__return_true' );
@@ -2386,21 +2398,33 @@  discard block
 block discarded – undo
2386 2398
 		return Jetpack::admin_url( array( 'page' => 'jetpack', 'configure' => $module ) );
2387 2399
 	}
2388 2400
 
2401
+	/**
2402
+	 * @param string $module
2403
+	 */
2389 2404
 	public static function module_configuration_load( $module, $method ) {
2390 2405
 		$module = Jetpack::get_module_slug( $module );
2391 2406
 		add_action( 'jetpack_module_configuration_load_' . $module, $method );
2392 2407
 	}
2393 2408
 
2409
+	/**
2410
+	 * @param string $module
2411
+	 */
2394 2412
 	public static function module_configuration_head( $module, $method ) {
2395 2413
 		$module = Jetpack::get_module_slug( $module );
2396 2414
 		add_action( 'jetpack_module_configuration_head_' . $module, $method );
2397 2415
 	}
2398 2416
 
2417
+	/**
2418
+	 * @param string $module
2419
+	 */
2399 2420
 	public static function module_configuration_screen( $module, $method ) {
2400 2421
 		$module = Jetpack::get_module_slug( $module );
2401 2422
 		add_action( 'jetpack_module_configuration_screen_' . $module, $method );
2402 2423
 	}
2403 2424
 
2425
+	/**
2426
+	 * @param string $module
2427
+	 */
2404 2428
 	public static function module_configuration_activation_screen( $module, $method ) {
2405 2429
 		$module = Jetpack::get_module_slug( $module );
2406 2430
 		add_action( 'display_activate_module_setting_' . $module, $method );
@@ -2408,6 +2432,9 @@  discard block
 block discarded – undo
2408 2432
 
2409 2433
 /* Installation */
2410 2434
 
2435
+	/**
2436
+	 * @param string $message
2437
+	 */
2411 2438
 	public static function bail_on_activation( $message, $deactivate = true ) {
2412 2439
 ?>
2413 2440
 <!doctype html>
@@ -3008,7 +3035,7 @@  discard block
 block discarded – undo
3008 3035
 	 * Add help to the Jetpack page
3009 3036
 	 *
3010 3037
 	 * @since Jetpack (1.2.3)
3011
-	 * @return false if not the Jetpack page
3038
+	 * @return false|null if not the Jetpack page
3012 3039
 	 */
3013 3040
 	function admin_help() {
3014 3041
 		$current_screen = get_current_screen();
@@ -4046,6 +4073,7 @@  discard block
 block discarded – undo
4046 4073
 	/**
4047 4074
 	 * Returns the requested Jetpack API URL
4048 4075
 	 *
4076
+	 * @param string $relative_url
4049 4077
 	 * @return string
4050 4078
 	 */
4051 4079
 	public static function api_url( $relative_url ) {
@@ -4190,7 +4218,8 @@  discard block
 block discarded – undo
4190 4218
 	 * Note these tokens are unique per call, NOT static per site for connecting.
4191 4219
 	 *
4192 4220
 	 * @since 2.6
4193
-	 * @return array
4221
+	 * @param string $action
4222
+	 * @return string
4194 4223
 	 */
4195 4224
 	public function generate_secrets( $action, $exp = 600 ) {
4196 4225
 	    $secret = wp_generate_password( 32, false ) // secret_1
@@ -4496,6 +4525,10 @@  discard block
 block discarded – undo
4496 4525
 		return new WP_User( $token_details['user_id'] );
4497 4526
 	}
4498 4527
 
4528
+	/**
4529
+	 * @param integer $timestamp
4530
+	 * @param string $nonce
4531
+	 */
4499 4532
 	function add_nonce( $timestamp, $nonce ) {
4500 4533
 		global $wpdb;
4501 4534
 		static $nonces_used_this_request = array();
@@ -4701,6 +4734,9 @@  discard block
 block discarded – undo
4701 4734
 		Jetpack::state( null, null, true );
4702 4735
 	}
4703 4736
 
4737
+	/**
4738
+	 * @param string $file
4739
+	 */
4704 4740
 	public static function check_privacy( $file ) {
4705 4741
 		static $is_site_publicly_accessible = null;
4706 4742
 
@@ -5028,7 +5064,7 @@  discard block
 block discarded – undo
5028 5064
 	/**
5029 5065
 	 * Pings the WordPress.com Mirror Site for the specified options.
5030 5066
 	 *
5031
-	 * @param string|array $option_names The option names to request from the WordPress.com Mirror Site
5067
+	 * @param string[] $option_names The option names to request from the WordPress.com Mirror Site
5032 5068
 	 *
5033 5069
 	 * @return array An associative array of the option values as stored in the WordPress.com Mirror Site
5034 5070
 	 */
@@ -5052,7 +5088,7 @@  discard block
 block discarded – undo
5052 5088
 	/**
5053 5089
 	 * Fetch the filtered array of options that we should compare to determine an identity crisis.
5054 5090
 	 *
5055
-	 * @return array An array of options to check.
5091
+	 * @return string[] An array of options to check.
5056 5092
 	 */
5057 5093
 	public static function identity_crisis_options_to_check() {
5058 5094
 		return array(
@@ -5595,8 +5631,8 @@  discard block
 block discarded – undo
5595 5631
 	 *  - Absolute URLs             `http://domain.com/feh.png`
5596 5632
 	 *  - Domain root relative URLs `/feh.png`
5597 5633
 	 *
5598
-	 * @param $css string: The raw CSS -- should be read in directly from the file.
5599
-	 * @param $css_file_url : The URL that the file can be accessed at, for calculating paths from.
5634
+	 * @param string $css string: The raw CSS -- should be read in directly from the file.
5635
+	 * @param string $css_file_url : The URL that the file can be accessed at, for calculating paths from.
5600 5636
 	 *
5601 5637
 	 * @return mixed|string
5602 5638
 	 */
@@ -5905,7 +5941,7 @@  discard block
 block discarded – undo
5905 5941
 	 *
5906 5942
 	 * @param string $option_name
5907 5943
 	 *
5908
-	 * @return bool
5944
+	 * @return false|null
5909 5945
 	 */
5910 5946
 	public static function jumpstart_has_updated_module_option( $option_name = '' ) {
5911 5947
 		// Bail if Jump Start has already been dismissed
@@ -5996,7 +6032,6 @@  discard block
 block discarded – undo
5996 6032
 	}
5997 6033
 
5998 6034
 	/**
5999
-	 * @param mixed $result Value for the user's option
6000 6035
 	 * @return mixed
6001 6036
 	 */
6002 6037
 	function get_user_option_meta_box_order_dashboard( $sorted ) {
Please login to merge, or discard this patch.