Skip to content

Commit b51a3d6

Browse files
committed
More PHPCS fixes and some PHPDoc updates
1 parent 598259f commit b51a3d6

2 files changed

Lines changed: 17 additions & 8 deletions

File tree

src/Kobas/APIClient/Auth/Provider.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,15 +89,15 @@ public function getAccessToken()
8989
{
9090
$provider = $this->getProvider();
9191

92-
if (
93-
!is_array(self::$tokens) ||
92+
if (!is_array(self::$tokens) ||
9493
!array_key_exists($provider->companyId, self::$tokens) ||
9594
!self::$tokens[$provider->companyId] instanceof AccessToken ||
9695
self::$tokens[$provider->companyId]->hasExpired()
9796
) {
9897
try {
9998
self::$tokens[$provider->companyId] = $provider->getAccessToken(
100-
'client_credentials', ['scope' => $this->scopes]
99+
'client_credentials',
100+
['scope' => $this->scopes]
101101
);
102102
} catch (IdentityProviderException $e) {
103103
throw new AuthenticationException($e->getMessage(), $e->getCode());

src/Kobas/APIClient/Client.php

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,22 +110,25 @@ public function setAPIVersion($version)
110110
* @param array $params
111111
* @param array $headers
112112
* @return mixed
113-
* @throws HttpException
114113
* @throws CurlException
114+
* @throws Exception\AuthenticationException
115+
* @throws HttpException
115116
*/
116117
public function get($route, array $params = array(), array $headers = array())
117118
{
118119
return $this->call('GET', $route, $params, $headers);
119120
}
120121

122+
121123
/**
122124
* @param $http_method
123125
* @param $route
124126
* @param array $params
125127
* @param array $headers
126128
* @return mixed
127-
* @throws HttpException
128129
* @throws CurlException
130+
* @throws Exception\AuthenticationException
131+
* @throws HttpException
129132
*/
130133
protected function call($http_method, $route, array $params = array(), array $headers = array())
131134
{
@@ -193,39 +196,45 @@ protected function call($http_method, $route, array $params = array(), array $he
193196
return json_decode($result, true);
194197
}
195198

199+
196200
/**
197201
* @param $route
198202
* @param array $params
199203
* @param array $headers
200204
* @return mixed
201-
* @throws HttpException
202205
* @throws CurlException
206+
* @throws Exception\AuthenticationException
207+
* @throws HttpException
203208
*/
204209
public function post($route, array $params = array(), array $headers = array())
205210
{
206211
return $this->call('POST', $route, $params, $headers);
207212
}
208213

214+
209215
/**
210216
* @param $route
211217
* @param array $params
212218
* @param array $headers
213219
* @return mixed
214-
* @throws HttpException
215220
* @throws CurlException
221+
* @throws Exception\AuthenticationException
222+
* @throws HttpException
216223
*/
217224
public function put($route, array $params = array(), array $headers = array())
218225
{
219226
return $this->call('PUT', $route, $params, $headers);
220227
}
221228

229+
222230
/**
223231
* @param $route
224232
* @param array $params
225233
* @param array $headers
226234
* @return mixed
227-
* @throws HttpException
228235
* @throws CurlException
236+
* @throws Exception\AuthenticationException
237+
* @throws HttpException
229238
*/
230239
public function delete($route, array $params = array(), array $headers = array())
231240
{

0 commit comments

Comments
 (0)