@@ -146,7 +146,7 @@ |
||
| 146 | 146 | */ |
| 147 | 147 | public function getItems() |
| 148 | 148 | { |
| 149 | - if (! isset($this->source->items)) { |
|
| 149 | + if (!isset($this->source->items)) { |
|
| 150 | 150 | $this->items = new ArrayCollection(); |
| 151 | 151 | } |
| 152 | 152 | |
@@ -152,7 +152,7 @@ discard block |
||
| 152 | 152 | */ |
| 153 | 153 | public function getSuggestions() |
| 154 | 154 | { |
| 155 | - if (! isset($this->source->suggestions)) { |
|
| 155 | + if (!isset($this->source->suggestions)) { |
|
| 156 | 156 | $this->suggestions = new ArrayCollection(); |
| 157 | 157 | } |
| 158 | 158 | |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | */ |
| 167 | 167 | public function getFacets() |
| 168 | 168 | { |
| 169 | - if (! isset($this->source->facets)) { |
|
| 169 | + if (!isset($this->source->facets)) { |
|
| 170 | 170 | $this->facets = new ArrayCollection(); |
| 171 | 171 | } |
| 172 | 172 | |
@@ -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 | } |
@@ -63,7 +63,7 @@ |
||
| 63 | 63 | */ |
| 64 | 64 | public function getValues() |
| 65 | 65 | { |
| 66 | - if (! isset($this->source->values)) { |
|
| 66 | + if (!isset($this->source->values)) { |
|
| 67 | 67 | $this->values = new ArrayCollection(); |
| 68 | 68 | } |
| 69 | 69 | |
@@ -65,7 +65,7 @@ |
||
| 65 | 65 | 'file' => $file, |
| 66 | 66 | )); |
| 67 | 67 | |
| 68 | - switch ((int)$response->getResult()->entity) { |
|
| 68 | + switch ((int) $response->getResult()->entity) { |
|
| 69 | 69 | case 0: |
| 70 | 70 | $matches = array(); |
| 71 | 71 | preg_match('/\/records\/(\d+)\/(\d+)\//', $response->getResult()->url, $matches); |
@@ -129,7 +129,7 @@ |
||
| 129 | 129 | */ |
| 130 | 130 | public function getFacets() |
| 131 | 131 | { |
| 132 | - if (! isset($this->source->facets)) { |
|
| 132 | + if (!isset($this->source->facets)) { |
|
| 133 | 133 | $this->facets = new ArrayCollection(); |
| 134 | 134 | } |
| 135 | 135 | |
@@ -96,7 +96,7 @@ |
||
| 96 | 96 | try { |
| 97 | 97 | $responseContent = $this->adapter->call( |
| 98 | 98 | 'POST', |
| 99 | - $this->getUrl() . static::TOKEN_ENDPOINT, |
|
| 99 | + $this->getUrl().static::TOKEN_ENDPOINT, |
|
| 100 | 100 | array(), |
| 101 | 101 | $postFields |
| 102 | 102 | ); |
@@ -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 | |
@@ -112,8 +112,8 @@ |
||
| 112 | 112 | { |
| 113 | 113 | $entity = new static::$mappings[$name]['entity'](); |
| 114 | 114 | |
| 115 | - array_walk($data, function ($value, $property) use ($entity) { |
|
| 116 | - $method = 'set'.implode('', array_map(function ($chunk) { |
|
| 115 | + array_walk($data, function($value, $property) use ($entity) { |
|
| 116 | + $method = 'set'.implode('', array_map(function($chunk) { |
|
| 117 | 117 | return ucfirst($chunk); |
| 118 | 118 | }, preg_split('/[-_]/', $property))); |
| 119 | 119 | |
@@ -21,17 +21,17 @@ discard block |
||
| 21 | 21 | { |
| 22 | 22 | // 't' param is used for cache busting |
| 23 | 23 | $parameters = [ |
| 24 | - 'includes' => [ 'elements' ], |
|
| 24 | + 'includes' => ['elements'], |
|
| 25 | 25 | 't' => time() |
| 26 | 26 | ]; |
| 27 | 27 | |
| 28 | - $response = $this->query('GET', 'v2/orders/' . $orderId, $parameters); |
|
| 28 | + $response = $this->query('GET', 'v2/orders/'.$orderId, $parameters); |
|
| 29 | 29 | |
| 30 | 30 | if ($response->isEmpty()) { |
| 31 | 31 | throw new RuntimeException('Response content is empty'); |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | - if (! $response->hasProperty('data')) { |
|
| 34 | + if (!$response->hasProperty('data')) { |
|
| 35 | 35 | throw new RuntimeException('Missing \'data\' property in response'); |
| 36 | 36 | } |
| 37 | 37 | |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | $parameters = [ |
| 45 | 45 | 'page' => max($pageIndex, 0), |
| 46 | 46 | 'per_page' => max($pageSize, 1), |
| 47 | - 'includes' => [ 'elements' ], |
|
| 47 | + 'includes' => ['elements'], |
|
| 48 | 48 | 't' => time() |
| 49 | 49 | ]; |
| 50 | 50 | |
@@ -54,11 +54,11 @@ discard block |
||
| 54 | 54 | throw new RuntimeException('Response content is empty'); |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | - if (! $response->hasProperty('data')) { |
|
| 57 | + if (!$response->hasProperty('data')) { |
|
| 58 | 58 | throw new RuntimeException('Missing \'data\' property in response'); |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | - if (! $response->hasProperty('meta')) { |
|
| 61 | + if (!$response->hasProperty('meta')) { |
|
| 62 | 62 | throw new RuntimeException('Missing \'meta\' property in response'); |
| 63 | 63 | } |
| 64 | 64 | |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | 'records' => $recordsIds |
| 75 | 75 | ]; |
| 76 | 76 | |
| 77 | - $response = $this->query('POST', 'v2/orders/', [], [ 'data' => $parameters ], [ |
|
| 77 | + $response = $this->query('POST', 'v2/orders/', [], ['data' => $parameters], [ |
|
| 78 | 78 | 'Accept' => 'application/json', |
| 79 | 79 | 'Content-Type' => 'application/json' |
| 80 | 80 | ]); |
@@ -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 | |