@@ -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 | |
@@ -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 | ); |
@@ -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 | ]); |
@@ -12,7 +12,6 @@ |
||
| 12 | 12 | namespace PhraseanetSDK\Entity; |
| 13 | 13 | |
| 14 | 14 | use DateTime; |
| 15 | -use DateTimeInterface; |
|
| 16 | 15 | use Doctrine\Common\Collections\ArrayCollection; |
| 17 | 16 | use Exception; |
| 18 | 17 | use stdClass; |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | */ |
| 112 | 112 | public function getId(): string |
| 113 | 113 | { |
| 114 | - return $this->getDataboxId() . '_' . $this->getRecordId(); |
|
| 114 | + return $this->getDataboxId().'_'.$this->getRecordId(); |
|
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | /** |
@@ -224,7 +224,7 @@ discard block |
||
| 224 | 224 | */ |
| 225 | 225 | public function getThumbnail(): ?Subdef |
| 226 | 226 | { |
| 227 | - if (! isset($this->source->thumbnail)) { |
|
| 227 | + if (!isset($this->source->thumbnail)) { |
|
| 228 | 228 | return null; |
| 229 | 229 | } |
| 230 | 230 | |
@@ -258,7 +258,7 @@ discard block |
||
| 258 | 258 | */ |
| 259 | 259 | public function getTechnicalInformation() |
| 260 | 260 | { |
| 261 | - if (! isset($this->source->technical_informations)) { |
|
| 261 | + if (!isset($this->source->technical_informations)) { |
|
| 262 | 262 | $this->technicalInformation = new ArrayCollection(); |
| 263 | 263 | } |
| 264 | 264 | |
@@ -274,7 +274,7 @@ discard block |
||
| 274 | 274 | */ |
| 275 | 275 | public function getSubdefs() |
| 276 | 276 | { |
| 277 | - if (! isset($this->source->subdefs)) { |
|
| 277 | + if (!isset($this->source->subdefs)) { |
|
| 278 | 278 | $this->subdefs = new ArrayCollection(); |
| 279 | 279 | } |
| 280 | 280 | |
@@ -286,7 +286,7 @@ discard block |
||
| 286 | 286 | */ |
| 287 | 287 | public function getStatus() |
| 288 | 288 | { |
| 289 | - if (! isset($this->source->status)) { |
|
| 289 | + if (!isset($this->source->status)) { |
|
| 290 | 290 | $this->status = new ArrayCollection(); |
| 291 | 291 | } |
| 292 | 292 | |
@@ -298,7 +298,7 @@ discard block |
||
| 298 | 298 | */ |
| 299 | 299 | public function getCaption() |
| 300 | 300 | { |
| 301 | - if (! isset($this->source->caption)) { |
|
| 301 | + if (!isset($this->source->caption)) { |
|
| 302 | 302 | $this->caption = new ArrayCollection(); |
| 303 | 303 | } |
| 304 | 304 | |
@@ -310,7 +310,7 @@ discard block |
||
| 310 | 310 | */ |
| 311 | 311 | public function getMetadata() |
| 312 | 312 | { |
| 313 | - if (! isset($this->source->metadata)) { |
|
| 313 | + if (!isset($this->source->metadata)) { |
|
| 314 | 314 | $this->metadata = new ArrayCollection(); |
| 315 | 315 | } |
| 316 | 316 | |