@@ -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 | { |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | public function __construct() |
20 | 20 | { |
21 | 21 | $validationResult = ModelValidator::validateModel(new ReflectionClass(static::class)); |
22 | - if (! $validationResult->passes()) { |
|
22 | + if (!$validationResult->passes()) { |
|
23 | 23 | throw new InvalidModelException('Model is invalid: "' . implode('","', $validationResult->getErrors()) . '"'); |
24 | 24 | } |
25 | 25 | } |
@@ -36,13 +36,13 @@ discard block |
||
36 | 36 | */ |
37 | 37 | public function __set(string $name, mixed $value): void |
38 | 38 | { |
39 | - if (! property_exists($this, $name)) { |
|
39 | + if (!property_exists($this, $name)) { |
|
40 | 40 | throw new NonExistingPropertyException('Property with name "' . $name . '" does not exist'); |
41 | 41 | } |
42 | 42 | |
43 | 43 | $validationResult = PropertyValidator::validateProperty((new ReflectionClass(static::class))->getProperty($name), $value); |
44 | - if (! $validationResult->passes()) { |
|
45 | - throw new ValidationException('Value "' . $value . '" for property "' . $name . '" is invalid: "' . implode('","', $validationResult->getErrors()) . '"'); |
|
44 | + if (!$validationResult->passes()) { |
|
45 | + throw new ValidationException('Value "' . $value . '" for property "' . $name . '" is invalid: "' . implode('","', $validationResult->getErrors()) . '"'); |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | $this->{$name} = $value; |