Passed
Push — master ( 6e2e80...73e0b1 )
by Sergey
06:37
created
src/Api/Endpoints/Organizations.php 1 patch
Indentation   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -5,34 +5,34 @@
 block discarded – undo
5 5
 
6 6
 class Organizations extends CrudEndpoint
7 7
 {
8
-    /**
9
-     * @param string $id
10
-     * @return array
11
-     */
12
-    public function getById($id)
13
-    {
14
-        $this->headers['organizationId'] = $id;
8
+	/**
9
+	 * @param string $id
10
+	 * @return array
11
+	 */
12
+	public function getById($id)
13
+	{
14
+		$this->headers['organizationId'] = $id;
15 15
 
16
-        return parent::getById($id);
17
-    }
16
+		return parent::getById($id);
17
+	}
18 18
 
19
-    /**
20
-     * @param string $itemId
21
-     * @param array $attributes
22
-     * @return mixed
23
-     */
24
-    public function update($itemId, array $attributes)
25
-    {
26
-        $this->headers['organizationId'] = $itemId;
19
+	/**
20
+	 * @param string $itemId
21
+	 * @param array $attributes
22
+	 * @return mixed
23
+	 */
24
+	public function update($itemId, array $attributes)
25
+	{
26
+		$this->headers['organizationId'] = $itemId;
27 27
 
28
-        return parent::update($itemId, $attributes);
29
-    }
28
+		return parent::update($itemId, $attributes);
29
+	}
30 30
 
31
-    /**
32
-     * {@inheritdoc}
33
-     */
34
-    public function endpoint()
35
-    {
36
-        return 'organizations';
37
-    }
31
+	/**
32
+	 * {@inheritdoc}
33
+	 */
34
+	public function endpoint()
35
+	{
36
+		return 'organizations';
37
+	}
38 38
 }
Please login to merge, or discard this patch.
src/Api/Endpoints/Users.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -4,11 +4,11 @@
 block discarded – undo
4 4
 
5 5
 class Users extends Endpoint
6 6
 {
7
-    /**
8
-     * {@inheritdoc}
9
-     */
10
-    public function endpoint()
11
-    {
12
-        return 'users';
13
-    }
7
+	/**
8
+	 * {@inheritdoc}
9
+	 */
10
+	public function endpoint()
11
+	{
12
+		return 'users';
13
+	}
14 14
 }
Please login to merge, or discard this patch.
src/Api/Endpoints/Cards.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -4,11 +4,11 @@
 block discarded – undo
4 4
 
5 5
 class Cards extends CrudEndpoint
6 6
 {
7
-    /**
8
-     * {@inheritdoc}
9
-     */
10
-    public function endpoint()
11
-    {
12
-        return 'cards';
13
-    }
7
+	/**
8
+	 * {@inheritdoc}
9
+	 */
10
+	public function endpoint()
11
+	{
12
+		return 'cards';
13
+	}
14 14
 }
Please login to merge, or discard this patch.
src/Api/Endpoints/Columns.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -4,11 +4,11 @@
 block discarded – undo
4 4
 
5 5
 class Columns extends CrudEndpoint
6 6
 {
7
-    /**
8
-     * {@inheritdoc}
9
-     */
10
-    public function endpoint()
11
-    {
12
-        return 'columns';
13
-    }
7
+	/**
8
+	 * {@inheritdoc}
9
+	 */
10
+	public function endpoint()
11
+	{
12
+		return 'columns';
13
+	}
14 14
 }
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 Client
13
-     */
14
-    protected $client;
15
-
16
-    /**
17
-     * @var array
18
-     */
19
-    protected $responseHeaders;
20
-
21
-    /**
22
-     * @param Client $client
23
-     */
24
-    public function __construct(Client $client)
25
-    {
26
-        $this->client = $client;
27
-    }
28
-
29
-    /**
30
-     * @param string $uri
31
-     * @param array $params
32
-     * @param array $headers
33
-     * @return array
34
-     */
35
-    public function get($uri, array $params = [], array $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 array
53
-     */
54
-    public function post($uri, array $body = [], array $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, array $body = [], array $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, array $body = [], array $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 Client
13
+	 */
14
+	protected $client;
15
+
16
+	/**
17
+	 * @var array
18
+	 */
19
+	protected $responseHeaders;
20
+
21
+	/**
22
+	 * @param Client $client
23
+	 */
24
+	public function __construct(Client $client)
25
+	{
26
+		$this->client = $client;
27
+	}
28
+
29
+	/**
30
+	 * @param string $uri
31
+	 * @param array $params
32
+	 * @param array $headers
33
+	 * @return array
34
+	 */
35
+	public function get($uri, array $params = [], array $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 array
53
+	 */
54
+	public function post($uri, array $body = [], array $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, array $body = [], array $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, array $body = [], array $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
 }
Please login to merge, or discard this patch.
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 string $uri
9
-     * @param array $params
10
-     * @param array $headers
11
-     * @return array
12
-     */
13
-    public function get($uri, array $params = [], array $headers = []);
7
+	/**
8
+	 * @param string $uri
9
+	 * @param array $params
10
+	 * @param array $headers
11
+	 * @return array
12
+	 */
13
+	public function get($uri, array $params = [], array $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, array $body = [], array $headers = []);
15
+	/**
16
+	 * @param string $uri
17
+	 * @param array $body
18
+	 * @param array $headers
19
+	 * @return array
20
+	 */
21
+	public function post($uri, array $body = [], array $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, array $body = [], array $headers = []);
23
+	/**
24
+	 * @param string $uri
25
+	 * @param array $body
26
+	 * @param array $headers
27
+	 * @return mixed
28
+	 */
29
+	public function put($uri, array $body = [], array $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, array $body = [], array $headers = []);
31
+	/**
32
+	 * @param string $uri
33
+	 * @param array $body
34
+	 * @param array $headers
35
+	 * @return mixed
36
+	 */
37
+	public function delete($uri, array $body = [], array $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
 }
Please login to merge, or discard this patch.