Passed
Pull Request — master (#3)
by
unknown
08:48
created
src/Contracts/HttpClient.php 1 patch
Indentation   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -4,46 +4,46 @@
 block discarded – undo
4 4
 
5 5
 interface HttpClient
6 6
 {
7
-    /**
8
-     * @param $uri
9
-     * @param array $params
10
-     * @param array $headers
11
-     * @return array
12
-     */
13
-    public function get($uri, $params = [], $headers = []);
7
+	/**
8
+	 * @param $uri
9
+	 * @param array $params
10
+	 * @param array $headers
11
+	 * @return array
12
+	 */
13
+	public function get($uri, $params = [], $headers = []);
14 14
 
15
-    /**
16
-     * @param string $uri
17
-     * @param array $body
18
-     * @param array $headers
19
-     * @return array
20
-     */
21
-    public function post($uri, $body = [], $headers = []);
15
+	/**
16
+	 * @param string $uri
17
+	 * @param array $body
18
+	 * @param array $headers
19
+	 * @return array
20
+	 */
21
+	public function post($uri, $body = [], $headers = []);
22 22
 
23
-    /**
24
-     * @param string $uri
25
-     * @param array $body
26
-     * @param array $headers
27
-     * @return mixed
28
-     */
29
-    public function put($uri, $body = [], $headers = []);
23
+	/**
24
+	 * @param string $uri
25
+	 * @param array $body
26
+	 * @param array $headers
27
+	 * @return mixed
28
+	 */
29
+	public function put($uri, $body = [], $headers = []);
30 30
 
31
-    /**
32
-     * @param string $uri
33
-     * @param array $body
34
-     * @param array $headers
35
-     * @return mixed
36
-     */
37
-    public function delete($uri, $body = [], $headers = []);
31
+	/**
32
+	 * @param string $uri
33
+	 * @param array $body
34
+	 * @param array $headers
35
+	 * @return mixed
36
+	 */
37
+	public function delete($uri, $body = [], $headers = []);
38 38
 
39
-    /**
40
-     * @param string $url
41
-     * @return $this
42
-     */
43
-    public function setBaseUrl($url);
39
+	/**
40
+	 * @param string $url
41
+	 * @return $this
42
+	 */
43
+	public function setBaseUrl($url);
44 44
 
45
-    /**
46
-     * @return array
47
-     */
48
-    public function getResponseHeaders();
45
+	/**
46
+	 * @return array
47
+	 */
48
+	public function getResponseHeaders();
49 49
 }
50 50
\ No newline at end of file
Please login to merge, or discard this patch.
src/Api/Api.php 1 patch
Indentation   +91 added lines, -91 removed lines patch added patch discarded remove patch
@@ -32,95 +32,95 @@
 block discarded – undo
32 32
  */
33 33
 class Api
34 34
 {
35
-    /**
36
-     * @var EndpointsContainer
37
-     */
38
-    protected $endpointsContainer;
39
-
40
-    /**
41
-     * @var string
42
-     */
43
-    protected $organizationId;
44
-
45
-    public function __construct(EndpointsContainer $endpointsContainer)
46
-    {
47
-        $this->endpointsContainer = $endpointsContainer;
48
-    }
49
-
50
-    /**
51
-     * Magic method to access different endpoints.
52
-     *
53
-     * @param string $endpoint
54
-     *
55
-     * @return Endpoint
56
-     */
57
-    public function __get($endpoint)
58
-    {
59
-        $endpoint = $this->endpointsContainer->resolve($endpoint);
60
-
61
-        if (method_exists($endpoint, 'setOrganizationId')) {
62
-            $endpoint->setOrganizationId($this->organizationId);
63
-        }
64
-
65
-        return $endpoint;
66
-    }
67
-
68
-    /**
69
-     * @param $organizationName
70
-     * @return $this
71
-     */
72
-    public function setOrganization($organizationName)
73
-    {
74
-        if($organization = $this->getOrganizationByName($organizationName)) {
75
-            $this->setOrganizationId($organization['organizationId']);
76
-        }
77
-
78
-        return $this;
79
-    }
80
-
81
-    /**
82
-     * @param int $organizationId
83
-     * @return $this
84
-     */
85
-    public function setOrganizationId($organizationId)
86
-    {
87
-        $this->organizationId = $organizationId;
88
-
89
-        return $this;
90
-    }
91
-
92
-    /**
93
-     * @return string
94
-     */
95
-    public function getOrganizationId()
96
-    {
97
-        return $this->organizationId;
98
-    }
99
-
100
-    /**
101
-     * @param string $name
102
-     * @param array $arguments
103
-     * @return mixed
104
-     */
105
-    public function __call($name, $arguments)
106
-    {
107
-        return call_user_func([$this->endpointsContainer, $name], $arguments);
108
-    }
109
-
110
-    /**
111
-     * @param $organization
112
-     * @return array|bool
113
-     * @throws WrongOrganizationName
114
-     */
115
-    protected function getOrganizationByName($organization)
116
-    {
117
-        $organizations = $this->organizations->getAll();
118
-        foreach ($organizations['entities'] as $entity) {
119
-            if ($entity['name'] == $organization) {
120
-                return $entity;
121
-            }
122
-        }
123
-
124
-        throw new WrongOrganizationName("Organization $organization not found!");
125
-    }
35
+	/**
36
+	 * @var EndpointsContainer
37
+	 */
38
+	protected $endpointsContainer;
39
+
40
+	/**
41
+	 * @var string
42
+	 */
43
+	protected $organizationId;
44
+
45
+	public function __construct(EndpointsContainer $endpointsContainer)
46
+	{
47
+		$this->endpointsContainer = $endpointsContainer;
48
+	}
49
+
50
+	/**
51
+	 * Magic method to access different endpoints.
52
+	 *
53
+	 * @param string $endpoint
54
+	 *
55
+	 * @return Endpoint
56
+	 */
57
+	public function __get($endpoint)
58
+	{
59
+		$endpoint = $this->endpointsContainer->resolve($endpoint);
60
+
61
+		if (method_exists($endpoint, 'setOrganizationId')) {
62
+			$endpoint->setOrganizationId($this->organizationId);
63
+		}
64
+
65
+		return $endpoint;
66
+	}
67
+
68
+	/**
69
+	 * @param $organizationName
70
+	 * @return $this
71
+	 */
72
+	public function setOrganization($organizationName)
73
+	{
74
+		if($organization = $this->getOrganizationByName($organizationName)) {
75
+			$this->setOrganizationId($organization['organizationId']);
76
+		}
77
+
78
+		return $this;
79
+	}
80
+
81
+	/**
82
+	 * @param int $organizationId
83
+	 * @return $this
84
+	 */
85
+	public function setOrganizationId($organizationId)
86
+	{
87
+		$this->organizationId = $organizationId;
88
+
89
+		return $this;
90
+	}
91
+
92
+	/**
93
+	 * @return string
94
+	 */
95
+	public function getOrganizationId()
96
+	{
97
+		return $this->organizationId;
98
+	}
99
+
100
+	/**
101
+	 * @param string $name
102
+	 * @param array $arguments
103
+	 * @return mixed
104
+	 */
105
+	public function __call($name, $arguments)
106
+	{
107
+		return call_user_func([$this->endpointsContainer, $name], $arguments);
108
+	}
109
+
110
+	/**
111
+	 * @param $organization
112
+	 * @return array|bool
113
+	 * @throws WrongOrganizationName
114
+	 */
115
+	protected function getOrganizationByName($organization)
116
+	{
117
+		$organizations = $this->organizations->getAll();
118
+		foreach ($organizations['entities'] as $entity) {
119
+			if ($entity['name'] == $organization) {
120
+				return $entity;
121
+			}
122
+		}
123
+
124
+		throw new WrongOrganizationName("Organization $organization not found!");
125
+	}
126 126
 }
127 127
\ No newline at end of file
Please login to merge, or discard this patch.
src/Api/Endpoints/Endpoint.php 1 patch
Indentation   +121 added lines, -121 removed lines patch added patch discarded remove patch
@@ -6,125 +6,125 @@
 block discarded – undo
6 6
 
7 7
 class Endpoint
8 8
 {
9
-    /**
10
-     * @var array
11
-     */
12
-    protected $rateLimitInfo;
13
-
14
-    /**
15
-     * @var array
16
-     */
17
-    protected $allowedMethods = [
18
-        'getById',
19
-        'getAll',
20
-        'create',
21
-        'update',
22
-        'delete',
23
-    ];
24
-
25
-    /**
26
-     * @var string
27
-     */
28
-    protected $endpoint;
29
-
30
-    /**
31
-     * @var array
32
-     */
33
-    protected $headers = [];
34
-
35
-    /**
36
-     * @var HttpClient
37
-     */
38
-    protected $http;
39
-
40
-    /**
41
-     * @var string
42
-     */
43
-    protected $organizationId;
44
-
45
-    /**
46
-     * @param HttpClient $http
47
-     */
48
-    public function __construct(HttpClient $http)
49
-    {
50
-        $this->http = $http;
51
-    }
52
-
53
-    /**
54
-     * @param string $verb
55
-     * @return string
56
-     */
57
-    public function makeRequestUrl($verb = '')
58
-    {
59
-        return "https://favro.com/api/v1/{$this->endpoint}/$verb";
60
-    }
61
-
62
-    /**
63
-     * @param string $method
64
-     * @return bool
65
-     */
66
-    public function isMethodAllowed($method)
67
-    {
68
-        return in_array($method, $this->allowedMethods);
69
-    }
70
-
71
-    /**
72
-     * @return HttpClient
73
-     */
74
-    public function getHttp()
75
-    {
76
-        return $this->http;
77
-    }
78
-
79
-    /**
80
-     * @param array $params
81
-     * @return array
82
-     */
83
-    public function getAll(array $params = [])
84
-    {
85
-        return $this
86
-            ->getHttp()
87
-            ->get(
88
-                $this->makeRequestUrl(),
89
-                $params,
90
-                $this->getHeaders()
91
-            );
92
-    }
93
-
94
-    /**
95
-     * @param string $id
96
-     * @return array
97
-     */
98
-    public function getById($id)
99
-    {
100
-        return $this
101
-            ->getHttp()
102
-            ->get(
103
-                $this->makeRequestUrl($id),
104
-                [],
105
-                $this->getHeaders()
106
-            );
107
-    }
108
-
109
-    /**
110
-     * @return array
111
-     */
112
-    public function getHeaders()
113
-    {
114
-        return array_merge(
115
-            ['organizationId' => $this->organizationId],
116
-            $this->headers
117
-        );
118
-    }
119
-
120
-    /**
121
-     * @param string $organizationId
122
-     * @return $this
123
-     */
124
-    public function setOrganizationId($organizationId)
125
-    {
126
-        $this->organizationId = $organizationId;
127
-
128
-        return $this;
129
-    }
9
+	/**
10
+	 * @var array
11
+	 */
12
+	protected $rateLimitInfo;
13
+
14
+	/**
15
+	 * @var array
16
+	 */
17
+	protected $allowedMethods = [
18
+		'getById',
19
+		'getAll',
20
+		'create',
21
+		'update',
22
+		'delete',
23
+	];
24
+
25
+	/**
26
+	 * @var string
27
+	 */
28
+	protected $endpoint;
29
+
30
+	/**
31
+	 * @var array
32
+	 */
33
+	protected $headers = [];
34
+
35
+	/**
36
+	 * @var HttpClient
37
+	 */
38
+	protected $http;
39
+
40
+	/**
41
+	 * @var string
42
+	 */
43
+	protected $organizationId;
44
+
45
+	/**
46
+	 * @param HttpClient $http
47
+	 */
48
+	public function __construct(HttpClient $http)
49
+	{
50
+		$this->http = $http;
51
+	}
52
+
53
+	/**
54
+	 * @param string $verb
55
+	 * @return string
56
+	 */
57
+	public function makeRequestUrl($verb = '')
58
+	{
59
+		return "https://favro.com/api/v1/{$this->endpoint}/$verb";
60
+	}
61
+
62
+	/**
63
+	 * @param string $method
64
+	 * @return bool
65
+	 */
66
+	public function isMethodAllowed($method)
67
+	{
68
+		return in_array($method, $this->allowedMethods);
69
+	}
70
+
71
+	/**
72
+	 * @return HttpClient
73
+	 */
74
+	public function getHttp()
75
+	{
76
+		return $this->http;
77
+	}
78
+
79
+	/**
80
+	 * @param array $params
81
+	 * @return array
82
+	 */
83
+	public function getAll(array $params = [])
84
+	{
85
+		return $this
86
+			->getHttp()
87
+			->get(
88
+				$this->makeRequestUrl(),
89
+				$params,
90
+				$this->getHeaders()
91
+			);
92
+	}
93
+
94
+	/**
95
+	 * @param string $id
96
+	 * @return array
97
+	 */
98
+	public function getById($id)
99
+	{
100
+		return $this
101
+			->getHttp()
102
+			->get(
103
+				$this->makeRequestUrl($id),
104
+				[],
105
+				$this->getHeaders()
106
+			);
107
+	}
108
+
109
+	/**
110
+	 * @return array
111
+	 */
112
+	public function getHeaders()
113
+	{
114
+		return array_merge(
115
+			['organizationId' => $this->organizationId],
116
+			$this->headers
117
+		);
118
+	}
119
+
120
+	/**
121
+	 * @param string $organizationId
122
+	 * @return $this
123
+	 */
124
+	public function setOrganizationId($organizationId)
125
+	{
126
+		$this->organizationId = $organizationId;
127
+
128
+		return $this;
129
+	}
130 130
 }
131 131
\ No newline at end of file
Please login to merge, or discard this patch.
src/GuzzleHttpClient.php 1 patch
Indentation   +126 added lines, -126 removed lines patch added patch discarded remove patch
@@ -8,130 +8,130 @@
 block discarded – undo
8 8
 
9 9
 class GuzzleHttpClient implements HttpClient
10 10
 {
11
-    /**
12
-     * @var ClientInterface
13
-     */
14
-    protected $client;
15
-
16
-    /**
17
-     * @var array
18
-     */
19
-    protected $responseHeaders;
20
-
21
-    /**
22
-     * @param ClientInterface $client
23
-     */
24
-    public function __construct(ClientInterface $client)
25
-    {
26
-        $this->client = $client;
27
-    }
28
-
29
-    /**
30
-     * @param string $uri
31
-     * @param array $params
32
-     * @param array $headers
33
-     * @return string
34
-     */
35
-    public function get($uri, $params = [], $headers = [])
36
-    {
37
-        if (!empty($params)) {
38
-            $uri .= '?' . http_build_query($params);
39
-        }
40
-
41
-        $response = $this
42
-            ->client
43
-            ->get($uri, ['headers' => $headers]);
44
-
45
-        return $this->parseResponse($response);
46
-    }
47
-
48
-    /**
49
-     * @param string $uri
50
-     * @param array $body
51
-     * @param array $headers
52
-     * @return string
53
-     */
54
-    public function post($uri, $body = [], $headers = [])
55
-    {
56
-        $response = $this
57
-            ->client
58
-            ->post(
59
-                $uri, [
60
-                    'headers'     => $headers,
61
-                    'form_params' => $body,
62
-                ]
63
-            );
64
-
65
-        return $this->parseResponse($response);
66
-    }
67
-
68
-    /**
69
-     * @param string $uri
70
-     * @param array $body
71
-     * @param array $headers
72
-     * @return mixed
73
-     */
74
-    public function put($uri, $body = [], $headers = [])
75
-    {
76
-        $response = $this
77
-            ->client
78
-            ->put(
79
-                $uri, [
80
-                    'headers'     => $headers,
81
-                    'form_params' => $body,
82
-                ]
83
-            );
84
-
85
-        return $this->parseResponse($response);
86
-    }
87
-
88
-    /**
89
-     * @param string $uri
90
-     * @param array $body
91
-     * @param array $headers
92
-     * @return mixed
93
-     */
94
-    public function delete($uri, $body = [], $headers = [])
95
-    {
96
-        $response = $this
97
-            ->client
98
-            ->delete($uri, [
99
-                'headers'     => $headers,
100
-                'form_params' => $body,
101
-            ]);
102
-
103
-        return $this->parseResponse($response);
104
-    }
105
-
106
-    /**
107
-     * @param string $url
108
-     * @return $this
109
-     */
110
-    public function setBaseUrl($url)
111
-    {
112
-        $this->client->setBaseUrl($url);
113
-
114
-        return $this;
115
-    }
116
-
117
-    /**
118
-     * @param ResponseInterface $response
119
-     * @return array|null
120
-     */
121
-    protected function parseResponse(ResponseInterface $response)
122
-    {
123
-        $responseContents = $response->getBody()->getContents();
124
-
125
-        $this->responseHeaders = $response->getHeaders();
126
-
127
-        return json_decode($responseContents, true);
128
-    }
129
-
130
-    /**
131
-     * @return array
132
-     */
133
-    public function getResponseHeaders()
134
-    {
135
-        return $this->responseHeaders;
136
-    }
11
+	/**
12
+	 * @var ClientInterface
13
+	 */
14
+	protected $client;
15
+
16
+	/**
17
+	 * @var array
18
+	 */
19
+	protected $responseHeaders;
20
+
21
+	/**
22
+	 * @param ClientInterface $client
23
+	 */
24
+	public function __construct(ClientInterface $client)
25
+	{
26
+		$this->client = $client;
27
+	}
28
+
29
+	/**
30
+	 * @param string $uri
31
+	 * @param array $params
32
+	 * @param array $headers
33
+	 * @return string
34
+	 */
35
+	public function get($uri, $params = [], $headers = [])
36
+	{
37
+		if (!empty($params)) {
38
+			$uri .= '?' . http_build_query($params);
39
+		}
40
+
41
+		$response = $this
42
+			->client
43
+			->get($uri, ['headers' => $headers]);
44
+
45
+		return $this->parseResponse($response);
46
+	}
47
+
48
+	/**
49
+	 * @param string $uri
50
+	 * @param array $body
51
+	 * @param array $headers
52
+	 * @return string
53
+	 */
54
+	public function post($uri, $body = [], $headers = [])
55
+	{
56
+		$response = $this
57
+			->client
58
+			->post(
59
+				$uri, [
60
+					'headers'     => $headers,
61
+					'form_params' => $body,
62
+				]
63
+			);
64
+
65
+		return $this->parseResponse($response);
66
+	}
67
+
68
+	/**
69
+	 * @param string $uri
70
+	 * @param array $body
71
+	 * @param array $headers
72
+	 * @return mixed
73
+	 */
74
+	public function put($uri, $body = [], $headers = [])
75
+	{
76
+		$response = $this
77
+			->client
78
+			->put(
79
+				$uri, [
80
+					'headers'     => $headers,
81
+					'form_params' => $body,
82
+				]
83
+			);
84
+
85
+		return $this->parseResponse($response);
86
+	}
87
+
88
+	/**
89
+	 * @param string $uri
90
+	 * @param array $body
91
+	 * @param array $headers
92
+	 * @return mixed
93
+	 */
94
+	public function delete($uri, $body = [], $headers = [])
95
+	{
96
+		$response = $this
97
+			->client
98
+			->delete($uri, [
99
+				'headers'     => $headers,
100
+				'form_params' => $body,
101
+			]);
102
+
103
+		return $this->parseResponse($response);
104
+	}
105
+
106
+	/**
107
+	 * @param string $url
108
+	 * @return $this
109
+	 */
110
+	public function setBaseUrl($url)
111
+	{
112
+		$this->client->setBaseUrl($url);
113
+
114
+		return $this;
115
+	}
116
+
117
+	/**
118
+	 * @param ResponseInterface $response
119
+	 * @return array|null
120
+	 */
121
+	protected function parseResponse(ResponseInterface $response)
122
+	{
123
+		$responseContents = $response->getBody()->getContents();
124
+
125
+		$this->responseHeaders = $response->getHeaders();
126
+
127
+		return json_decode($responseContents, true);
128
+	}
129
+
130
+	/**
131
+	 * @return array
132
+	 */
133
+	public function getResponseHeaders()
134
+	{
135
+		return $this->responseHeaders;
136
+	}
137 137
 }
138 138
\ No newline at end of file
Please login to merge, or discard this patch.
src/Favro.php 1 patch
Indentation   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -8,42 +8,42 @@
 block discarded – undo
8 8
 
9 9
 class Favro
10 10
 {
11
-    /**
12
-     * @param string $login
13
-     * @param string $password
14
-     * @return Api
15
-     */
16
-    public static function create($login, $password)
17
-    {
18
-        $endpointsContainer = new EndpointsContainer(
19
-            self::getHttpInterfaceAdapter($login, $password)
20
-        );
21
-        return new Api($endpointsContainer);
22
-    }
11
+	/**
12
+	 * @param string $login
13
+	 * @param string $password
14
+	 * @return Api
15
+	 */
16
+	public static function create($login, $password)
17
+	{
18
+		$endpointsContainer = new EndpointsContainer(
19
+			self::getHttpInterfaceAdapter($login, $password)
20
+		);
21
+		return new Api($endpointsContainer);
22
+	}
23 23
 
24
-    /**
25
-     * @param string $login
26
-     * @param string $password
27
-     * @return GuzzleHttpClient
28
-     */
29
-    protected static function getHttpInterfaceAdapter($login, $password)
30
-    {
31
-        return new GuzzleHttpClient(
32
-            new Client(['auth' => [$login, $password]])
33
-        );
34
-    }
24
+	/**
25
+	 * @param string $login
26
+	 * @param string $password
27
+	 * @return GuzzleHttpClient
28
+	 */
29
+	protected static function getHttpInterfaceAdapter($login, $password)
30
+	{
31
+		return new GuzzleHttpClient(
32
+			new Client(['auth' => [$login, $password]])
33
+		);
34
+	}
35 35
 
36
-    /**
37
-     * @codeCoverageIgnore
38
-     */
39
-    private function __construct()
40
-    {
41
-    }
36
+	/**
37
+	 * @codeCoverageIgnore
38
+	 */
39
+	private function __construct()
40
+	{
41
+	}
42 42
 
43
-    /**
44
-     * @codeCoverageIgnore
45
-     */
46
-    private function __clone()
47
-    {
48
-    }
43
+	/**
44
+	 * @codeCoverageIgnore
45
+	 */
46
+	private function __clone()
47
+	{
48
+	}
49 49
 }
50 50
\ No newline at end of file
Please login to merge, or discard this patch.
src/Api/Endpoints/EndpointsContainer.php 1 patch
Indentation   +56 added lines, -56 removed lines patch added patch discarded remove patch
@@ -8,75 +8,75 @@
 block discarded – undo
8 8
 
9 9
 class EndpointsContainer
10 10
 {
11
-    /*
11
+	/*
12 12
     * @var HttpInterface
13 13
     */
14
-    protected $httpClient;
14
+	protected $httpClient;
15 15
 
16
-    /*
16
+	/*
17 17
      * @var array
18 18
      */
19
-    protected $endpoints = [];
19
+	protected $endpoints = [];
20 20
 
21
-    /**
22
-     * @param HttpClient $httpClient
23
-     */
24
-    public function __construct(HttpClient $httpClient)
25
-    {
26
-        $this->httpClient = $httpClient;
27
-    }
21
+	/**
22
+	 * @param HttpClient $httpClient
23
+	 */
24
+	public function __construct(HttpClient $httpClient)
25
+	{
26
+		$this->httpClient = $httpClient;
27
+	}
28 28
 
29
-    /**
30
-     * @param string $endpoint
31
-     * @return Endpoint
32
-     */
33
-    public function resolve($endpoint)
34
-    {
35
-        $endpoint = strtolower($endpoint);
29
+	/**
30
+	 * @param string $endpoint
31
+	 * @return Endpoint
32
+	 */
33
+	public function resolve($endpoint)
34
+	{
35
+		$endpoint = strtolower($endpoint);
36 36
 
37
-        // Check if an instance has already been initiated
38
-        if (!isset($this->endpoints[$endpoint])) {
39
-            $this->addProvider($endpoint);
40
-        }
37
+		// Check if an instance has already been initiated
38
+		if (!isset($this->endpoints[$endpoint])) {
39
+			$this->addProvider($endpoint);
40
+		}
41 41
 
42
-        return $this->endpoints[$endpoint];
43
-    }
42
+		return $this->endpoints[$endpoint];
43
+	}
44 44
 
45
-    /**
46
-     * @param $endpoint
47
-     * @throws WrongEndpoint
48
-     */
49
-    protected function addProvider($endpoint)
50
-    {
51
-        $className = __NAMESPACE__ . '\\' . ucfirst($endpoint);
45
+	/**
46
+	 * @param $endpoint
47
+	 * @throws WrongEndpoint
48
+	 */
49
+	protected function addProvider($endpoint)
50
+	{
51
+		$className = __NAMESPACE__ . '\\' . ucfirst($endpoint);
52 52
 
53
-        if (!class_exists($className)) {
54
-            throw new WrongEndpoint("Endpoint $className not found.");
55
-        }
53
+		if (!class_exists($className)) {
54
+			throw new WrongEndpoint("Endpoint $className not found.");
55
+		}
56 56
 
57
-        $this->endpoints[$endpoint] = $this->buildEndpoint($className);
58
-    }
57
+		$this->endpoints[$endpoint] = $this->buildEndpoint($className);
58
+	}
59 59
 
60
-    /**
61
-     * @param string $className
62
-     * @return Endpoint|object
63
-     */
64
-    protected function buildEndpoint($className)
65
-    {
66
-        return (new ReflectionClass($className))->newInstanceArgs([$this->httpClient]);
67
-    }
60
+	/**
61
+	 * @param string $className
62
+	 * @return Endpoint|object
63
+	 */
64
+	protected function buildEndpoint($className)
65
+	{
66
+		return (new ReflectionClass($className))->newInstanceArgs([$this->httpClient]);
67
+	}
68 68
 
69
-    /**
70
-     * @return array
71
-     */
72
-    public function getRateInfo()
73
-    {
74
-        $responseHeaders = $this->httpClient->getResponseHeaders();
69
+	/**
70
+	 * @return array
71
+	 */
72
+	public function getRateInfo()
73
+	{
74
+		$responseHeaders = $this->httpClient->getResponseHeaders();
75 75
 
76
-        return [
77
-            'reset'     => $responseHeaders['X-RateLimit-Reset'][0],
78
-            'limit'     => $responseHeaders['X-RateLimit-Limit'][0],
79
-            'remaining' => $responseHeaders['X-RateLimit-Remaining'][0],
80
-        ];
81
-    }
76
+		return [
77
+			'reset'     => $responseHeaders['X-RateLimit-Reset'][0],
78
+			'limit'     => $responseHeaders['X-RateLimit-Limit'][0],
79
+			'remaining' => $responseHeaders['X-RateLimit-Remaining'][0],
80
+		];
81
+	}
82 82
 }
Please login to merge, or discard this patch.
src/Api/Endpoints/Cards.php 1 patch
Indentation   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -4,24 +4,24 @@
 block discarded – undo
4 4
 
5 5
 class Cards extends CrudEndpoint
6 6
 {
7
-    /**
8
-     * @var string
9
-     */
10
-    protected $endpoint = 'cards';
7
+	/**
8
+	 * @var string
9
+	 */
10
+	protected $endpoint = 'cards';
11 11
 
12
-    /**
13
-     * @param string $cardId
14
-     * @param bool $everywhere
15
-     * @return mixed
16
-     */
17
-    public function delete($cardId, $everywhere)
18
-    {
19
-        return $this
20
-            ->getHttp()
21
-            ->delete(
22
-                $this->makeRequestUrl($cardId),
23
-                ['everywhere' => $everywhere],
24
-                $this->getHeaders()
25
-            );
26
-    }
12
+	/**
13
+	 * @param string $cardId
14
+	 * @param bool $everywhere
15
+	 * @return mixed
16
+	 */
17
+	public function delete($cardId, $everywhere)
18
+	{
19
+		return $this
20
+			->getHttp()
21
+			->delete(
22
+				$this->makeRequestUrl($cardId),
23
+				['everywhere' => $everywhere],
24
+				$this->getHeaders()
25
+			);
26
+	}
27 27
 }
Please login to merge, or discard this patch.