@@ -9,7 +9,7 @@ |
||
| 9 | 9 | #[Attribute] |
| 10 | 10 | class Between implements Rule |
| 11 | 11 | { |
| 12 | - public function __construct(private float|int $largerThanOrEquals, private float|int $smallerThanOrEquals){} |
|
| 12 | + public function __construct(private float | int $largerThanOrEquals, private float | int $smallerThanOrEquals) {} |
|
| 13 | 13 | |
| 14 | 14 | public function applicableToTypes(): array |
| 15 | 15 | { |
@@ -9,7 +9,7 @@ |
||
| 9 | 9 | #[Attribute] |
| 10 | 10 | class BetweenExclusive implements Rule |
| 11 | 11 | { |
| 12 | - public function __construct(private float|int $largerThan, private float|int $smallerThan){} |
|
| 12 | + public function __construct(private float | int $largerThan, private float | int $smallerThan) {} |
|
| 13 | 13 | |
| 14 | 14 | public function applicableToTypes(): array |
| 15 | 15 | { |
@@ -9,7 +9,7 @@ |
||
| 9 | 9 | #[Attribute] |
| 10 | 10 | class SmallerThan implements Rule |
| 11 | 11 | { |
| 12 | - public function __construct(private float|int $smallerThan){} |
|
| 12 | + public function __construct(private float | int $smallerThan) {} |
|
| 13 | 13 | |
| 14 | 14 | public function applicableToTypes(): array |
| 15 | 15 | { |
@@ -9,7 +9,7 @@ |
||
| 9 | 9 | #[Attribute] |
| 10 | 10 | class LargerThan implements Rule |
| 11 | 11 | { |
| 12 | - public function __construct(private float|int $largerThan){} |
|
| 12 | + public function __construct(private float | int $largerThan) {} |
|
| 13 | 13 | |
| 14 | 14 | public function applicableToTypes(): array |
| 15 | 15 | { |
@@ -9,7 +9,7 @@ |
||
| 9 | 9 | #[Attribute] |
| 10 | 10 | class LargerThanOrEquals implements Rule |
| 11 | 11 | { |
| 12 | - public function __construct(private float|int $largerThanOrEquals){} |
|
| 12 | + public function __construct(private float | int $largerThanOrEquals) {} |
|
| 13 | 13 | |
| 14 | 14 | public function applicableToTypes(): array |
| 15 | 15 | { |
@@ -9,7 +9,7 @@ |
||
| 9 | 9 | #[Attribute] |
| 10 | 10 | class SmallerThanOrEquals implements Rule |
| 11 | 11 | { |
| 12 | - public function __construct(private float|int $smallerThanOrEquals){} |
|
| 12 | + public function __construct(private float | int $smallerThanOrEquals) {} |
|
| 13 | 13 | |
| 14 | 14 | public function applicableToTypes(): array |
| 15 | 15 | { |
@@ -42,7 +42,7 @@ |
||
| 42 | 42 | |
| 43 | 43 | $validationResult = PropertyValidator::validateProperty((new ReflectionClass(static::class))->getProperty($name), $value); |
| 44 | 44 | if ($validationResult->passes() === false) { |
| 45 | - throw new ValidationException('Value "' . $value . '" for property "' . $name . '" is invalid: "' . implode('","', $validationResult->getErrors()) . '"'); |
|
| 45 | + throw new ValidationException('Value "' . $value . '" for property "' . $name . '" is invalid: "' . implode('","', $validationResult->getErrors()) . '"'); |
|
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | $this->{$name} = $value; |
@@ -13,11 +13,11 @@ |
||
| 13 | 13 | $validationResult = new ValidationResult(); |
| 14 | 14 | foreach ($reflectionProperty->getAttributes() as $attribute) { |
| 15 | 15 | $attributeInstance = $attribute->newInstance(); |
| 16 | - if (! $attributeInstance instanceof Rule) { |
|
| 16 | + if (!$attributeInstance instanceof Rule) { |
|
| 17 | 17 | continue; |
| 18 | 18 | } |
| 19 | 19 | |
| 20 | - if (! $attributeInstance->isValid($value)) { |
|
| 20 | + if (!$attributeInstance->isValid($value)) { |
|
| 21 | 21 | $validationResult->addError($attributeInstance->getMessage()); |
| 22 | 22 | } |
| 23 | 23 | } |