@@ -27,33 +27,33 @@ |
||
27 | 27 | * MethodNotAllowedException|NotFoundException|RateLimitExceededException|UnsupportedAcceptHeaderException| |
28 | 28 | * UnsupportedContentTypeException|ValidationException |
29 | 29 | */ |
30 | - public static function create(RequestException $e) { |
|
30 | + public static function create(RequestException $e) { |
|
31 | 31 | |
32 | - if($response = $e->getResponse()) { |
|
32 | + if($response = $e->getResponse()) { |
|
33 | 33 | |
34 | - switch ($response->getStatusCode()) { |
|
35 | - case 400: |
|
34 | + switch ($response->getStatusCode()) { |
|
35 | + case 400: |
|
36 | 36 | return new ValidationException($e); |
37 | - case 401: |
|
37 | + case 401: |
|
38 | 38 | return new AuthenticationException($e); |
39 | - case 403: |
|
39 | + case 403: |
|
40 | 40 | return new AccessDeniedException($e); |
41 | - case 404: |
|
41 | + case 404: |
|
42 | 42 | return new NotFoundException($e); |
43 | - case 405: |
|
43 | + case 405: |
|
44 | 44 | return new MethodNotAllowedException($e); |
45 | - case 406: |
|
45 | + case 406: |
|
46 | 46 | return new UnsupportedAcceptHeaderException($e); |
47 | - case 409: |
|
47 | + case 409: |
|
48 | 48 | return new ConflictingStateException($e); |
49 | - case 415: |
|
49 | + case 415: |
|
50 | 50 | return new UnsupportedContentTypeException($e); |
51 | - case 429: |
|
51 | + case 429: |
|
52 | 52 | return new RateLimitExceededException($e); |
53 | - } |
|
54 | - } |
|
53 | + } |
|
54 | + } |
|
55 | 55 | |
56 | - return new ApiException($e); |
|
56 | + return new ApiException($e); |
|
57 | 57 | } |
58 | 58 | |
59 | 59 | /** |
@@ -29,7 +29,7 @@ |
||
29 | 29 | */ |
30 | 30 | public static function create(RequestException $e) { |
31 | 31 | |
32 | - if($response = $e->getResponse()) { |
|
32 | + if ($response = $e->getResponse()) { |
|
33 | 33 | |
34 | 34 | switch ($response->getStatusCode()) { |
35 | 35 | case 400: |
@@ -152,9 +152,9 @@ |
||
152 | 152 | */ |
153 | 153 | public function search(string $filtersQuery) |
154 | 154 | { |
155 | - $end = '/search'.$this->endpoint(); |
|
155 | + $end = '/search' . $this->endpoint(); |
|
156 | 156 | $query = [ |
157 | - 'query' => '"'.$filtersQuery.'"', |
|
157 | + 'query' => '"' . $filtersQuery . '"', |
|
158 | 158 | ]; |
159 | 159 | return $this->api()->request('GET', $end, null, $query); |
160 | 160 | } |