@@ -15,7 +15,7 @@ |
||
| 15 | 15 | public function checkHasRatio(string $ratio, bool $throwException = false) |
| 16 | 16 | { |
| 17 | 17 | foreach ($this->value as $item) { |
| 18 | - if (! empty($item->offsetGet('ratio')) |
|
| 18 | + if (!empty($item->offsetGet('ratio')) |
|
| 19 | 19 | && $item->offsetGet('ratio') === $ratio |
| 20 | 20 | ) { |
| 21 | 21 | return $this; |
@@ -23,10 +23,10 @@ discard block |
||
| 23 | 23 | */ |
| 24 | 24 | public function __construct($value = null, $errorMessage = null) |
| 25 | 25 | { |
| 26 | - if (! empty($value)) { |
|
| 26 | + if (!empty($value)) { |
|
| 27 | 27 | $this->value = $value; |
| 28 | 28 | } |
| 29 | - if (! empty($value)) { |
|
| 29 | + if (!empty($value)) { |
|
| 30 | 30 | $this->errorMessage = $errorMessage; |
| 31 | 31 | } |
| 32 | 32 | } |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | */ |
| 63 | 63 | public function setErrorMessage($errorMessage = null): self |
| 64 | 64 | { |
| 65 | - if (! empty($errorMessage) && is_string($errorMessage)) { |
|
| 65 | + if (!empty($errorMessage) && is_string($errorMessage)) { |
|
| 66 | 66 | $this->errorMessage = $errorMessage; |
| 67 | 67 | return $this; |
| 68 | 68 | } |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | if ($field === Article::ATTACHMENT_FIELD_PHOTO) { |
| 137 | 137 | $this->validator->setValue($article->getAttachmentByField($field)); |
| 138 | 138 | $this->validator->checkHasRatio(Photo::RATIO_VERTICAL); |
| 139 | - if (! $this->validator->validate()) { |
|
| 139 | + if (!$this->validator->validate()) { |
|
| 140 | 140 | return [ |
| 141 | 141 | 'error_message' => $this->validator->getErrorMessage(), |
| 142 | 142 | ]; |
@@ -203,7 +203,7 @@ discard block |
||
| 203 | 203 | { |
| 204 | 204 | $articleOnRest = $this->getArticle($idArticle); |
| 205 | 205 | |
| 206 | - if (! empty($articleOnRest)) { |
|
| 206 | + if (!empty($articleOnRest)) { |
|
| 207 | 207 | $articleOnRest = json_decode($articleOnRest, true); |
| 208 | 208 | |
| 209 | 209 | if (isset($articleOnRest['data'])) { |
@@ -508,7 +508,7 @@ discard block |
||
| 508 | 508 | */ |
| 509 | 509 | private function hasValidator(string $validatorType = ''): bool |
| 510 | 510 | { |
| 511 | - return ! empty($this->validator) |
|
| 511 | + return !empty($this->validator) |
|
| 512 | 512 | && |
| 513 | 513 | is_a($this->validator, $validatorType); |
| 514 | 514 | } |
@@ -520,7 +520,7 @@ discard block |
||
| 520 | 520 | private function createValidator(string $validatorType = ''): void |
| 521 | 521 | { |
| 522 | 522 | if ($validatorType === self::PHOTO_ATTACHMENT_VALIDATOR) { |
| 523 | - if (! $this->hasValidator($validatorType)) { |
|
| 523 | + if (!$this->hasValidator($validatorType)) { |
|
| 524 | 524 | $this->validator = new PhotoAttachmentsValidator(); |
| 525 | 525 | } |
| 526 | 526 | } else { |