Completed
Push — try/namespacing-all-the-things ( 457764 )
by
unknown
08:24
created
class.jetpack.php 1 patch
Doc Comments   +25 added lines, -15 removed lines patch added patch discarded remove patch
@@ -759,7 +759,7 @@  discard block
 block discarded – undo
759 759
 	 * This is ported over from the manage module, which has been deprecated and baked in here.
760 760
 	 *
761 761
 	 * @param $domains
762
-	 * @return array
762
+	 * @return string[]
763 763
 	 */
764 764
 	function allow_wpcom_domain( $domains ) {
765 765
 		if ( empty( $domains ) ) {
@@ -1279,7 +1279,7 @@  discard block
 block discarded – undo
1279 1279
 	}
1280 1280
 	/**
1281 1281
 	 * Does the network allow admins to add new users.
1282
-	 * @return boolian
1282
+	 * @return boolean
1283 1283
 	 */
1284 1284
 	static function network_add_new_users( $option = null ) {
1285 1285
 		return (bool) get_site_option( 'add_new_users' );
@@ -1384,7 +1384,7 @@  discard block
 block discarded – undo
1384 1384
 	 * database which could be set to anything as opposed to what this function returns.
1385 1385
 	 * @param  bool  $option
1386 1386
 	 *
1387
-	 * @return boolean
1387
+	 * @return string
1388 1388
 	 */
1389 1389
 	public function is_main_network_option( $option ) {
1390 1390
 		// return '1' or ''
@@ -1395,7 +1395,7 @@  discard block
 block discarded – undo
1395 1395
 	 * Return true if we are with multi-site or multi-network false if we are dealing with single site.
1396 1396
 	 *
1397 1397
 	 * @param  string  $option
1398
-	 * @return boolean
1398
+	 * @return string
1399 1399
 	 */
1400 1400
 	public function is_multisite( $option ) {
1401 1401
 		return (string) (bool) is_multisite();
@@ -1457,7 +1457,7 @@  discard block
 block discarded – undo
1457 1457
 
1458 1458
 	/**
1459 1459
 	 * Returns true if the site has file write access false otherwise.
1460
-	 * @return string ( '1' | '0' )
1460
+	 * @return integer ( '1' | '0' )
1461 1461
 	 **/
1462 1462
 	public static function file_system_write_access() {
1463 1463
 		if ( ! function_exists( 'get_filesystem_method' ) ) {
@@ -2613,7 +2613,7 @@  discard block
 block discarded – undo
2613 2613
 	 *
2614 2614
 	 * @param string $tag Tag as it appears in each module heading.
2615 2615
 	 *
2616
-	 * @return mixed
2616
+	 * @return string
2617 2617
 	 */
2618 2618
 	public static function translate_module_tag( $tag ) {
2619 2619
 		return jetpack_get_module_i18n_tag( $tag );
@@ -2785,8 +2785,8 @@  discard block
 block discarded – undo
2785 2785
 	 * Rewrites ABSPATH (eg `/home/jetpack/wordpress/`) to ABSPATH, and if WP_CONTENT_DIR
2786 2786
 	 * is located outside of ABSPATH, rewrites that to WP_CONTENT_DIR.
2787 2787
 	 *
2788
-	 * @param $string
2789
-	 * @return mixed
2788
+	 * @param string $string
2789
+	 * @return string|null
2790 2790
 	 */
2791 2791
 	public static function alias_directories( $string ) {
2792 2792
 		// ABSPATH has a trailing slash.
@@ -3074,6 +3074,9 @@  discard block
 block discarded – undo
3074 3074
 	}
3075 3075
 
3076 3076
 /* Installation */
3077
+	/**
3078
+	 * @param string $message
3079
+	 */
3077 3080
 	public static function bail_on_activation( $message, $deactivate = true ) {
3078 3081
 ?>
3079 3082
 <!doctype html>
@@ -3807,7 +3810,7 @@  discard block
 block discarded – undo
3807 3810
 	 * Add help to the Jetpack page
3808 3811
 	 *
3809 3812
 	 * @since Jetpack (1.2.3)
3810
-	 * @return false if not the Jetpack page
3813
+	 * @return false|null if not the Jetpack page
3811 3814
 	 */
3812 3815
 	function admin_help() {
3813 3816
 		$current_screen = get_current_screen();
@@ -4689,6 +4692,7 @@  discard block
 block discarded – undo
4689 4692
 	/**
4690 4693
 	 * Returns the requested Jetpack API URL
4691 4694
 	 *
4695
+	 * @param string $relative_url
4692 4696
 	 * @return string
4693 4697
 	 */
4694 4698
 	public static function api_url( $relative_url ) {
@@ -4697,6 +4701,7 @@  discard block
 block discarded – undo
4697 4701
 
4698 4702
 	/**
4699 4703
 	 * Some hosts disable the OpenSSL extension and so cannot make outgoing HTTPS requsets
4704
+	 * @param string $url
4700 4705
 	 */
4701 4706
 	public static function fix_url_for_bad_hosts( $url ) {
4702 4707
 		if ( 0 !== strpos( $url, 'https://' ) ) {
@@ -4884,6 +4889,7 @@  discard block
 block discarded – undo
4884 4889
 	 * Note these tokens are unique per call, NOT static per site for connecting.
4885 4890
 	 *
4886 4891
 	 * @since 2.6
4892
+	 * @param string $action
4887 4893
 	 * @return array
4888 4894
 	 */
4889 4895
 	public static function generate_secrets( $action, $user_id = false, $exp = 600 ) {
@@ -5392,7 +5398,6 @@  discard block
 block discarded – undo
5392 5398
 	/**
5393 5399
 	 * Report authentication status to the WP REST API.
5394 5400
 	 *
5395
-	 * @param  WP_Error|mixed $result Error from another authentication handler, null if we should handle it, or another value if not
5396 5401
 	 * @return WP_Error|boolean|null {@see WP_JSON_Server::check_authentication}
5397 5402
 	 */
5398 5403
 	public function wp_rest_authentication_errors( $value ) {
@@ -5402,6 +5407,10 @@  discard block
 block discarded – undo
5402 5407
 		return $this->rest_authentication_status;
5403 5408
 	}
5404 5409
 
5410
+	/**
5411
+	 * @param integer $timestamp
5412
+	 * @param string $nonce
5413
+	 */
5405 5414
 	function add_nonce( $timestamp, $nonce ) {
5406 5415
 		global $wpdb;
5407 5416
 		static $nonces_used_this_request = array();
@@ -5547,6 +5556,7 @@  discard block
 block discarded – undo
5547 5556
 	 * @param string $key
5548 5557
 	 * @param string $value
5549 5558
 	 * @param bool $restate private
5559
+	 * @return string
5550 5560
 	 */
5551 5561
 	public static function state( $key = null, $value = null, $restate = false ) {
5552 5562
 		static $state = array();
@@ -5685,6 +5695,9 @@  discard block
 block discarded – undo
5685 5695
 		}
5686 5696
 	}
5687 5697
 
5698
+	/**
5699
+	 * @param string $url
5700
+	 */
5688 5701
 	public static function staticize_subdomain( $url ) {
5689 5702
 
5690 5703
 		// Extract hostname from URL
@@ -6235,9 +6248,7 @@  discard block
 block discarded – undo
6235 6248
 	 *
6236 6249
 	 * Attached to `style_loader_src` filter.
6237 6250
 	 *
6238
-	 * @param string $tag The tag that would link to the external asset.
6239 6251
 	 * @param string $handle The registered handle of the script in question.
6240
-	 * @param string $href The url of the asset in question.
6241 6252
 	 */
6242 6253
 	public static function set_suffix_on_min( $src, $handle ) {
6243 6254
 		if ( false === strpos( $src, '.min.css' ) ) {
@@ -6424,8 +6435,8 @@  discard block
 block discarded – undo
6424 6435
 	 *  - Absolute URLs             `http://domain.com/feh.png`
6425 6436
 	 *  - Domain root relative URLs `/feh.png`
6426 6437
 	 *
6427
-	 * @param $css string: The raw CSS -- should be read in directly from the file.
6428
-	 * @param $css_file_url : The URL that the file can be accessed at, for calculating paths from.
6438
+	 * @param string $css string: The raw CSS -- should be read in directly from the file.
6439
+	 * @param string $css_file_url : The URL that the file can be accessed at, for calculating paths from.
6429 6440
 	 *
6430 6441
 	 * @return mixed|string
6431 6442
 	 */
@@ -6724,7 +6735,6 @@  discard block
 block discarded – undo
6724 6735
 	}
6725 6736
 
6726 6737
 	/**
6727
-	 * @param mixed $result Value for the user's option
6728 6738
 	 * @return mixed
6729 6739
 	 */
6730 6740
 	function get_user_option_meta_box_order_dashboard( $sorted ) {
Please login to merge, or discard this patch.
packages/connection/src/Manager.php 1 patch
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 	 * WordPress.com.
60 60
 	 *
61 61
 	 * @param Integer $user_id the user identifier.
62
-	 * @return Boolean is the user connected?
62
+	 * @return integer is the user connected?
63 63
 	 */
64 64
 	public function is_user_connected( $user_id ) {
65 65
 		return $user_id;
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
 	 * Is the user the connection owner.
103 103
 	 *
104 104
 	 * @param Integer $user_id the user identifier.
105
-	 * @return Boolean is the user the connection owner?
105
+	 * @return integer is the user the connection owner?
106 106
 	 */
107 107
 	public function is_connection_owner( $user_id ) {
108 108
 		return $user_id;
@@ -546,7 +546,7 @@  discard block
 block discarded – undo
546 546
 	 * 2. Stored Normal Tokens (via Jetpack_Options::get_option( 'blog_token' ))
547 547
 	 * 3. Defined Normal Tokens (via the JETPACK_BLOG_TOKEN constant)
548 548
 	 *
549
-	 * @param int|false    $user_id   false: Return the Blog Token. int: Return that user's User Token.
549
+	 * @param boolean    $user_id   false: Return the Blog Token. int: Return that user's User Token.
550 550
 	 * @param string|false $token_key If provided, check that the token matches the provided input.
551 551
 	 *
552 552
 	 * @return object|false
Please login to merge, or discard this patch.
packages/options/legacy/class.jetpack-options.php 1 patch
Doc Comments   +11 added lines, -5 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
 	 *
19 19
 	 * @param string $type The type of option to return. Defaults to 'compact'.
20 20
 	 *
21
-	 * @return array
21
+	 * @return string[]
22 22
 	 */
23 23
 	public static function get_option_names( $type = 'compact' ) {
24 24
 		switch ( $type ) {
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
 	 * This does _not_ adjust the prefix in any way (does not prefix jetpack_%)
188 188
 	 *
189 189
 	 * @param string $name Option name
190
-	 * @param mixed  $default (optional)
190
+	 * @param string  $default (optional)
191 191
 	 *
192 192
 	 * @return mixed
193 193
 	 */
@@ -211,6 +211,9 @@  discard block
 block discarded – undo
211 211
 		return $value;
212 212
 	}
213 213
 
214
+	/**
215
+	 * @param string $name
216
+	 */
214 217
 	private static function update_grouped_option( $group, $name, $value ) {
215 218
 		$options = get_option( self::$grouped_options[ $group ] );
216 219
 		if ( ! is_array( $options ) ) {
@@ -312,6 +315,9 @@  discard block
 block discarded – undo
312 315
 		return $result;
313 316
 	}
314 317
 
318
+	/**
319
+	 * @param string $name
320
+	 */
315 321
 	private static function get_grouped_option( $group, $name, $default ) {
316 322
 		$options = get_option( self::$grouped_options[ $group ] );
317 323
 		if ( is_array( $options ) && isset( $options[ $name ] ) ) {
@@ -440,7 +446,7 @@  discard block
 block discarded – undo
440 446
 	 * This function checks for a constant that, if present, will disable direct DB queries Jetpack uses to manage certain options and force Jetpack to always use Options API instead.
441 447
 	 * Options can be selectively managed via a blacklist by filtering option names via the jetpack_disabled_raw_option filter.
442 448
 	 *
443
-	 * @param $name Option name
449
+	 * @param string $name Option name
444 450
 	 *
445 451
 	 * @return bool
446 452
 	 */
@@ -466,7 +472,7 @@  discard block
 block discarded – undo
466 472
 	 * @since 5.4.0
467 473
 	 *
468 474
 	 * @param boolean $strip_unsafe_options If true, and by default, will strip out options necessary for the connection to WordPress.com.
469
-	 * @return array An array of all options managed via the Jetpack_Options class.
475
+	 * @return string[] An array of all options managed via the Jetpack_Options class.
470 476
 	 */
471 477
 	static function get_all_jetpack_options( $strip_unsafe_options = true ) {
472 478
 		$jetpack_options            = self::get_option_names();
@@ -509,7 +515,7 @@  discard block
 block discarded – undo
509 515
 	 *
510 516
 	 * @since 5.4.0
511 517
 	 *
512
-	 * @return array
518
+	 * @return string[]
513 519
 	 */
514 520
 	static function get_all_wp_options() {
515 521
 		// A manual build of the wp options
Please login to merge, or discard this patch.
packages/tracking/src/lib/Client.php 1 patch
Doc Comments   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
 
48 48
 	/**
49 49
 	 * record_event
50
-	 * @param  mixed  $event Event object to send to Tracks. An array will be cast to object. Required.
50
+	 * @param  Event  $event Event object to send to Tracks. An array will be cast to object. Required.
51 51
 	 *                       Properties are included directly in the pixel query string after light validation.
52 52
 	 * @return mixed         True on success, WP_Error on failure
53 53
 	 */
@@ -74,6 +74,7 @@  discard block
 block discarded – undo
74 74
 
75 75
 	/**
76 76
 	 * Synchronously request the pixel
77
+	 * @param string $pixel
77 78
 	 */
78 79
 	static function record_pixel( $pixel ) {
79 80
 		// Add the Request Timestamp and URL terminator just before the HTTP request.
Please login to merge, or discard this patch.
packages/tracking/src/Tracking.php 1 patch
Doc Comments   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -143,6 +143,10 @@  discard block
 block discarded – undo
143 143
 	 * @param int $user_id The user id of the local user
144 144
 	 * @return array $identity
145 145
 	 */
146
+
147
+	/**
148
+	 * @param Connection\Manager $connection_manager
149
+	 */
146 150
 	static function jetpack_tracks_get_identity( $user_id, $connection_manager ) {
147 151
 
148 152
 		// Meta is set, and user is still connected.  Use WPCOM ID
@@ -186,7 +190,6 @@  discard block
 block discarded – undo
186 190
 	/**
187 191
 	 * Record an event in Tracks - this is the preferred way to record events from PHP.
188 192
 	 *
189
-	 * @param mixed  $identity username, user_id, or WP_user object
190 193
 	 * @param string $event_name The name of the event
191 194
 	 * @param array  $properties Custom properties to send with the event
192 195
 	 * @param int    $event_timestamp_millis The time in millis since 1970-01-01 00:00:00 when the event occurred
Please login to merge, or discard this patch.