@@ -18,7 +18,7 @@ |
||
| 18 | 18 | } |
| 19 | 19 | } |
| 20 | 20 | |
| 21 | - return $this->getMessage() . ":" . PHP_EOL . implode(PHP_EOL, $messages); |
|
| 21 | + return $this->getMessage().":".PHP_EOL.implode(PHP_EOL, $messages); |
|
| 22 | 22 | } |
| 23 | 23 | |
| 24 | 24 | /** |
@@ -32,12 +32,12 @@ |
||
| 32 | 32 | return new self; |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | - public static function of(string $field, Rule|RuleSet ...$rules): self |
|
| 35 | + public static function of(string $field, Rule | RuleSet ...$rules): self |
|
| 36 | 36 | { |
| 37 | 37 | return new self($field, ...$rules); |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | - public static function withRules(Rule|RuleSet ...$rules): self |
|
| 40 | + public static function withRules(Rule | RuleSet ...$rules): self |
|
| 41 | 41 | { |
| 42 | 42 | return new self(null, ...$rules); |
| 43 | 43 | } |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | * @param Rule|RuleSet ...$rules |
| 38 | 38 | * @return $this |
| 39 | 39 | */ |
| 40 | - public function field(string $field, Rule|RuleSet ...$rules): self |
|
| 40 | + public function field(string $field, Rule | RuleSet ...$rules): self |
|
| 41 | 41 | { |
| 42 | 42 | $ruleSet = $this->ruleSets[$field] ?? RuleSet::of($field); |
| 43 | 43 | $this->ruleSets[$field] = $ruleSet->add(...$rules); |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | * @return static |
| 125 | 125 | * @throws ReflectionException if the class does not exist |
| 126 | 126 | */ |
| 127 | - public static function fromProperties(string|object $objectOrClass, ?int $filter = null): self |
|
| 127 | + public static function fromProperties(string | object $objectOrClass, ?int $filter = null): self |
|
| 128 | 128 | { |
| 129 | 129 | $instance = new self; |
| 130 | 130 | $instance->ruleSets = RuleSetFactory::fromProperties($objectOrClass, $filter); |
@@ -37,8 +37,7 @@ |
||
| 37 | 37 | |
| 38 | 38 | $exception = |
| 39 | 39 | $validationException instanceof ValidationExceptionInterface ? |
| 40 | - $validationException : |
|
| 41 | - new ValidationException; |
|
| 40 | + $validationException : new ValidationException; |
|
| 42 | 41 | |
| 43 | 42 | $results = $guardResult instanceof Result ? [$guardResult] : $guardResult->validationResults(); |
| 44 | 43 | foreach ($results as $result) { |