@@ -49,7 +49,6 @@ |
||
| 49 | 49 | ): ValidationExceptionInterface { |
| 50 | 50 | return |
| 51 | 51 | $validationException instanceof ValidationExceptionInterface ? |
| 52 | - $validationException : |
|
| 53 | - new ValidationException(is_string($validationException) ? $validationException : ''); |
|
| 52 | + $validationException : new ValidationException(is_string($validationException) ? $validationException : ''); |
|
| 54 | 53 | } |
| 55 | 54 | } |
@@ -18,11 +18,11 @@ |
||
| 18 | 18 | */ |
| 19 | 19 | trait RuleChainTrait |
| 20 | 20 | { |
| 21 | - abstract public function add(Rule|RuleSet ...$rules): static; |
|
| 21 | + abstract public function add(Rule | RuleSet ...$rules): static; |
|
| 22 | 22 | |
| 23 | 23 | public function __call($name, $arguments): static |
| 24 | 24 | { |
| 25 | - $namespace = __NAMESPACE__ . '\\Rules'; |
|
| 25 | + $namespace = __NAMESPACE__.'\\Rules'; |
|
| 26 | 26 | $class = sprintf("%s\%s", $namespace, ucfirst($name)); |
| 27 | 27 | if (!class_exists($class)) { |
| 28 | 28 | throw new RuntimeException(sprintf('Rule not found: (%s).', $name)); |
@@ -27,8 +27,7 @@ |
||
| 27 | 27 | { |
| 28 | 28 | return |
| 29 | 29 | $this->isValid($input, $context) ? |
| 30 | - new ErrorReporting : |
|
| 31 | - (new ErrorReporting)->addError($this->message, $this->getField()); |
|
| 30 | + new ErrorReporting : (new ErrorReporting)->addError($this->message, $this->getField()); |
|
| 32 | 31 | } |
| 33 | 32 | |
| 34 | 33 | private function className(): string |