Completed
Push — staging ( 68fed3...485a71 )
by Evan
04:30
created

Yikes_Inc_Easy_MailChimp_API_Profile   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 34
rs 10
c 0
b 0
f 0
wmc 1
lcom 0
cbo 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A get_profile() 0 5 1
1
<?php
2
3
/**
4
 * User Profile handler.
5
 *
6
 * Note: This needs the V2 endpoint.
7
 *
8
 * @deprecated
9
 *
10
 * @author Jeremy Pry
11
 * @since  %VERSION%
12
 */
13
class Yikes_Inc_Easy_MailChimp_API_Profile extends Yikes_Inc_Easy_MailChimp_API_Abstract_Items {
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
14
15
	/**
16
	 * The base API path.
17
	 *
18
	 * @since %VERSION%
19
	 * @var string
20
	 */
21
	protected $base_path = 'users/profile.json';
22
23
	/**
24
	 * Whether a V2 API connection is required.
25
	 *
26
	 * @since %VERSION%
27
	 * @var bool
28
	 */
29
	protected $requires_v2 = true;
30
31
	/**
32
	 * Get profile data from the API.
33
	 *
34
	 * @author Jeremy Pry
35
	 * @since  %VERSION%
36
	 *
37
	 * @param bool $use_transients Whether to use a transient in the response.
38
	 *
39
	 * @return array|WP_Error
40
	 */
41
	public function get_profile( $use_transients = true ) {
42
		$transient_key = 'yikes_eme_user_profile';
43
44
		return $this->post_base_path( $transient_key, $use_transients );
45
	}
46
}
47