@@ -13,7 +13,7 @@ |
||
| 13 | 13 | |
| 14 | 14 | trait CommonFactory |
| 15 | 15 | { |
| 16 | - abstract public function add(Rule|RuleSet ...$rules): static; |
|
| 16 | + abstract public function add(Rule | RuleSet ...$rules): static; |
|
| 17 | 17 | |
| 18 | 18 | public function check(callable $rule, ?string $message = null): static |
| 19 | 19 | { |
@@ -9,7 +9,7 @@ |
||
| 9 | 9 | |
| 10 | 10 | trait ComparisonFactory |
| 11 | 11 | { |
| 12 | - abstract public function add(Rule|RuleSet ...$rules): static; |
|
| 12 | + abstract public function add(Rule | RuleSet ...$rules): static; |
|
| 13 | 13 | |
| 14 | 14 | public function equal($value, ?string $message = null): static |
| 15 | 15 | { |
@@ -12,7 +12,7 @@ |
||
| 12 | 12 | |
| 13 | 13 | trait DateTimeFactory |
| 14 | 14 | { |
| 15 | - abstract public function add(Rule|RuleSet ...$rules): static; |
|
| 15 | + abstract public function add(Rule | RuleSet ...$rules): static; |
|
| 16 | 16 | |
| 17 | 17 | public function isPast(?string $message = null): static |
| 18 | 18 | { |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | /** |
| 26 | 26 | * @throws ValidationException |
| 27 | 27 | */ |
| 28 | - final public function __construct(?string $field = null, Rule|RuleSet ...$rules) |
|
| 28 | + final public function __construct(?string $field = null, Rule | RuleSet ...$rules) |
|
| 29 | 29 | { |
| 30 | 30 | $this->rules = new SplObjectStorage; |
| 31 | 31 | $this->setField($field); |
@@ -37,17 +37,17 @@ discard block |
||
| 37 | 37 | return new self; |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | - public static function forField(string $field, Rule|RuleSet ...$rules): self |
|
| 40 | + public static function forField(string $field, Rule | RuleSet ...$rules): self |
|
| 41 | 41 | { |
| 42 | 42 | return new self($field, ...$rules); |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | - public static function withRules(Rule|RuleSet ...$rules): self |
|
| 45 | + public static function withRules(Rule | RuleSet ...$rules): self |
|
| 46 | 46 | { |
| 47 | 47 | return new self(null, ...$rules); |
| 48 | 48 | } |
| 49 | 49 | |
| 50 | - private function attachRules(Rule|RuleSet ...$rules): void |
|
| 50 | + private function attachRules(Rule | RuleSet ...$rules): void |
|
| 51 | 51 | { |
| 52 | 52 | foreach ($rules as $validationOrSet) { |
| 53 | 53 | if ($validationOrSet instanceof Rule) { |
@@ -62,14 +62,14 @@ discard block |
||
| 62 | 62 | } |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | - public function add(Rule|RuleSet ...$rules): static |
|
| 65 | + public function add(Rule | RuleSet ...$rules): static |
|
| 66 | 66 | { |
| 67 | 67 | $instance = clone $this; |
| 68 | 68 | $instance->attachRules(...$rules); |
| 69 | 69 | return $instance; |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | - public function validate(mixed $input, array $context = []): ValidationResult|ValidationResultByField |
|
| 72 | + public function validate(mixed $input, array $context = []): ValidationResult | ValidationResultByField |
|
| 73 | 73 | { |
| 74 | 74 | $violations = $empty = $this->newEmptyValidationResult(); |
| 75 | 75 | if (!$this->shouldValidate($input)) { |