@@ -188,11 +188,9 @@ |
||
| 188 | 188 | |
| 189 | 189 | // $this->addRequestParameters($request, $query, $postFields, $files); |
| 190 | 190 | // $response = $request->send(); |
| 191 | - } |
|
| 192 | - catch (GuzzleBadResponse $e) { |
|
| 191 | + } catch (GuzzleBadResponse $e) { |
|
| 193 | 192 | throw BadResponseException::fromGuzzleResponse($e); |
| 194 | - } |
|
| 195 | - catch (GuzzleException $e) { |
|
| 193 | + } catch (GuzzleException $e) { |
|
| 196 | 194 | throw new RuntimeException($e->getMessage(), $e->getCode(), $e); |
| 197 | 195 | } |
| 198 | 196 | |
@@ -67,8 +67,7 @@ |
||
| 67 | 67 | { |
| 68 | 68 | try { |
| 69 | 69 | $response = $this->getAdapter()->call($method, $path, $query, $postFields, array(), $headers); |
| 70 | - } |
|
| 71 | - catch (BadResponseException $e) { |
|
| 70 | + } catch (BadResponseException $e) { |
|
| 72 | 71 | $statusCode = $e->getStatusCode(); |
| 73 | 72 | switch ($statusCode) { |
| 74 | 73 | case 404: |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | * Search for records |
| 85 | 85 | * |
| 86 | 86 | * @param array $parameters Query parameters |
| 87 | - * @param int $pAPINumber API number (e.g. 3) |
|
| 87 | + * @param int $pAPINumber API number (e.g. 3) |
|
| 88 | 88 | * @return QueryEntity object |
| 89 | 89 | * @throws RuntimeException |
| 90 | 90 | * @throws UnauthorizedException |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | */ |
| 94 | 94 | public function search(array $parameters = [], int $pAPINumber = 1): QueryEntity |
| 95 | 95 | { |
| 96 | - $response = $this->query('POST', 'v'.$pAPINumber.'/search/', [], array_merge( |
|
| 96 | + $response = $this->query('POST', 'v'.$pAPINumber.'/search/', [], array_merge( |
|
| 97 | 97 | ['search_type' => 0], |
| 98 | 98 | $parameters |
| 99 | 99 | )); |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | * Search for stories |
| 79 | 79 | * |
| 80 | 80 | * @param array $parameters Query parameters |
| 81 | - * @param int $pAPINumber API number (e.g. 3) |
|
| 81 | + * @param int $pAPINumber API number (e.g. 3) |
|
| 82 | 82 | * @return QueryEntity object |
| 83 | 83 | * @throws RuntimeException |
| 84 | 84 | * @throws UnauthorizedException |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | { |
| 90 | 90 | $response = $this->query('POST', 'v'.$pAPINumber.'/search/', array(), array_merge( |
| 91 | 91 | $parameters, |
| 92 | - array('search_type' => SearchResult::TYPE_STORY) |
|
| 92 | + array('search_type' => SearchResult::TYPE_STORY) |
|
| 93 | 93 | )); |
| 94 | 94 | |
| 95 | 95 | if ($response->isEmpty()) { |
@@ -105,8 +105,7 @@ |
||
| 105 | 105 | ); |
| 106 | 106 | $data = json_decode($responseContent, true); |
| 107 | 107 | $token = $data["access_token"]; |
| 108 | - } |
|
| 109 | - catch (BadResponseException $e) { |
|
| 108 | + } catch (BadResponseException $e) { |
|
| 110 | 109 | $response = json_decode($e->getResponseBody(), true); |
| 111 | 110 | $msg = isset($response['error']) ? $response['error'] : (isset($response['msg']) ? $response['msg'] : ''); |
| 112 | 111 | |
@@ -198,7 +198,7 @@ |
||
| 198 | 198 | * @param $pValue mixed |
| 199 | 199 | */ |
| 200 | 200 | public function setSourceEntry(string $pKey, $pValue) |
| 201 | - { |
|
| 202 | - $this->source->$pKey = $pValue; |
|
| 203 | - } |
|
| 201 | + { |
|
| 202 | + $this->source->$pKey = $pValue; |
|
| 203 | + } |
|
| 204 | 204 | } |
@@ -239,7 +239,7 @@ |
||
| 239 | 239 | */ |
| 240 | 240 | public function getValidationInitiatorUser(): ?User |
| 241 | 241 | { |
| 242 | - return $this->validationInitiatorUser ?: ($this->validationInitiatorUser = User::fromValue($this->source->validation_initiator_user)); |
|
| 242 | + return $this->validationInitiatorUser ?: ($this->validationInitiatorUser = User::fromValue($this->source->validation_initiator_user)); |
|
| 243 | 243 | } |
| 244 | 244 | |
| 245 | 245 | /** |