Completed
Push — add/is-active-to-connection-pa... ( 30e22c...ed01dc )
by
unknown
20:07 queued 13:24
created

Jetpack_Data::is_usable_domain()   B

Complexity

Conditions 7
Paths 7

Size

Total Lines 53

Duplication

Lines 53
Ratio 100 %

Importance

Changes 0
Metric Value
cc 7
nc 7
nop 2
dl 53
loc 53
rs 8.0921
c 0
b 0
f 0

How to fix   Long Method   

Long Method

Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.

For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.

Commonly applied refactorings include:

1
<?php
2
3
class Jetpack_Data {
4
	/**
5
	 * @deprecated 7.5 Use Connection_Manager instead
6
	 *
7
	 * @param int|false    $user_id   false: Return the Blog Token. int: Return that user's User Token.
8
	 * @param string|false $token_key If provided, check that the token matches the provided input.
9
	 *                                false                                : Use first token. Default.
10
	 *                                Jetpack_Data::MAGIC_NORMAL_TOKEN_KEY : Use first Normal Token.
11
	 *                                non-empty string                     : Use matching token
12
	 * @return object|false
13
	 */
14
	public static function get_access_token( $user_id = false, $token_key = false ) {
15
		_deprecated_function( __METHOD__, '7.5', 'Connection_Manager' );
16
		$connection_manager = new Connection_Manager();
17
		return $connection_manager->get_access_token( $user_id, $token_key );
18
	}
19
}
20