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