@@ -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 |
@@ -16,7 +16,6 @@ |
||
16 | 16 | use PhraseanetSDK\Exception\NotFoundException; |
17 | 17 | use PhraseanetSDK\Exception\RuntimeException; |
18 | 18 | use Doctrine\Common\Collections\ArrayCollection; |
19 | -use PhraseanetSDK\EntityHydrator; |
|
20 | 19 | use PhraseanetSDK\Exception\TokenExpiredException; |
21 | 20 | use PhraseanetSDK\Exception\UnauthorizedException; |
22 | 21 |
@@ -15,7 +15,6 @@ |
||
15 | 15 | use PhraseanetSDK\Exception\NotFoundException; |
16 | 16 | use PhraseanetSDK\Exception\RuntimeException; |
17 | 17 | use Doctrine\Common\Collections\ArrayCollection; |
18 | -use PhraseanetSDK\EntityHydrator; |
|
19 | 18 | use PhraseanetSDK\Exception\TokenExpiredException; |
20 | 19 | use PhraseanetSDK\Exception\UnauthorizedException; |
21 | 20 | use PhraseanetSDK\Entity\Quarantine as QuarantineEntity; |
@@ -93,13 +93,13 @@ discard block |
||
93 | 93 | */ |
94 | 94 | public function requestPasswordReset(string $emailAddress): string |
95 | 95 | { |
96 | - $response = $this->query('POST', 'v1/accounts/reset-password/' . urlencode($emailAddress) . '/'); |
|
96 | + $response = $this->query('POST', 'v1/accounts/reset-password/'.urlencode($emailAddress).'/'); |
|
97 | 97 | |
98 | 98 | if (!$response->hasProperty('reset_token')) { |
99 | 99 | throw new RuntimeException('Missing "token" property in response content'); |
100 | 100 | } |
101 | 101 | |
102 | - return (string)$response->getProperty('reset_token'); |
|
102 | + return (string) $response->getProperty('reset_token'); |
|
103 | 103 | } |
104 | 104 | |
105 | 105 | /** |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | */ |
114 | 114 | public function resetPassword(string $token, string $password): bool |
115 | 115 | { |
116 | - $response = $this->query('POST', 'v1/accounts/update-password/' . $token . '/', array(), array( |
|
116 | + $response = $this->query('POST', 'v1/accounts/update-password/'.$token.'/', array(), array( |
|
117 | 117 | 'password' => $password |
118 | 118 | )); |
119 | 119 | |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | throw new RuntimeException('Missing "success" property in response content'); |
122 | 122 | } |
123 | 123 | |
124 | - return (bool)$response->getProperty('success'); |
|
124 | + return (bool) $response->getProperty('success'); |
|
125 | 125 | } |
126 | 126 | |
127 | 127 | /** |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | throw new RuntimeException('Missing "success" property in response content'); |
147 | 147 | } |
148 | 148 | |
149 | - return (bool)$response->getProperty('success'); |
|
149 | + return (bool) $response->getProperty('success'); |
|
150 | 150 | } |
151 | 151 | |
152 | 152 | /** |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | throw new RuntimeException('Missing "token" property in response content'); |
194 | 194 | } |
195 | 195 | |
196 | - return (string)$response->getProperty('token'); |
|
196 | + return (string) $response->getProperty('token'); |
|
197 | 197 | } |
198 | 198 | |
199 | 199 | public function updateUser(UserEntity $user) |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | throw new RuntimeException('Missing "success" property in response content'); |
223 | 223 | } |
224 | 224 | |
225 | - return (bool)$response->getProperty('success'); |
|
225 | + return (bool) $response->getProperty('success'); |
|
226 | 226 | } |
227 | 227 | |
228 | 228 | /** |
@@ -244,12 +244,12 @@ discard block |
||
244 | 244 | */ |
245 | 245 | public function unlockAccount(string $token): bool |
246 | 246 | { |
247 | - $response = $this->query('POST', 'v1/accounts/unlock/' . $token . '/'); |
|
247 | + $response = $this->query('POST', 'v1/accounts/unlock/'.$token.'/'); |
|
248 | 248 | |
249 | 249 | if (!$response->hasProperty('success')) { |
250 | 250 | throw new \RuntimeException('Missing "success" property in response content'); |
251 | 251 | } |
252 | 252 | |
253 | - return (bool)$response->getProperty('success'); |
|
253 | + return (bool) $response->getProperty('success'); |
|
254 | 254 | } |
255 | 255 | } |
@@ -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()) { |
@@ -56,7 +56,7 @@ |
||
56 | 56 | */ |
57 | 57 | public function getStatusCode(): int |
58 | 58 | { |
59 | - return (int)$this->meta->http_code; |
|
59 | + return (int) $this->meta->http_code; |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | /** |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | */ |
99 | 99 | public function isValidationItem(): bool |
100 | 100 | { |
101 | - return (bool)$this->source->validation_item; |
|
101 | + return (bool) $this->source->validation_item; |
|
102 | 102 | } |
103 | 103 | |
104 | 104 | /** |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | */ |
120 | 120 | public function getValidationChoices() |
121 | 121 | { |
122 | - if (! isset($this->source->validation_choices)) { |
|
122 | + if (!isset($this->source->validation_choices)) { |
|
123 | 123 | $this->validationChoices = new ArrayCollection(); |
124 | 124 | } |
125 | 125 |
@@ -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 | /** |
@@ -183,7 +183,7 @@ |
||
183 | 183 | */ |
184 | 184 | public function getValidationUsers(): ?ArrayCollection |
185 | 185 | { |
186 | - if (! $this->isValidationBasket()) { |
|
186 | + if (!$this->isValidationBasket()) { |
|
187 | 187 | return null; |
188 | 188 | } |
189 | 189 |