@@ -72,7 +72,7 @@ |
||
72 | 72 | |
73 | 73 | private function stopSign(Rule $rule, Result $result): int |
74 | 74 | { |
75 | - if (! $rule instanceof Stoppable) { |
|
75 | + if (!$rule instanceof Stoppable) { |
|
76 | 76 | return StopSign::DONT_STOP; |
77 | 77 | } |
78 | 78 |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | * @param Rule|RuleSet ...$rules |
39 | 39 | * @return $this |
40 | 40 | */ |
41 | - public function field(string $field, Rule|RuleSet ...$rules): self |
|
41 | + public function field(string $field, Rule | RuleSet ...$rules): self |
|
42 | 42 | { |
43 | 43 | $ruleSet = $this->ruleSets[$field] ?? RuleSet::of($field); |
44 | 44 | $this->ruleSets[$field] = $ruleSet->add(...$rules); |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | $errorReporting = new ErrorReporting; |
51 | 51 | foreach ($this->ruleSets as $field => $fieldRuleSet) { |
52 | 52 | $fieldRuleSet = $fieldRuleSet->setField($field); |
53 | - if (! $this->shouldValidate($fieldRuleSet, $data)) { |
|
53 | + if (!$this->shouldValidate($fieldRuleSet, $data)) { |
|
54 | 54 | continue; |
55 | 55 | } |
56 | 56 | |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | * @return static |
116 | 116 | * @throws ReflectionException if the class does not exist |
117 | 117 | */ |
118 | - public static function fromProperties(string|object $objectOrClass, ?int $filter = null): self |
|
118 | + public static function fromProperties(string | object $objectOrClass, ?int $filter = null): self |
|
119 | 119 | { |
120 | 120 | $instance = new self; |
121 | 121 | $instance->ruleSets = RuleSetFactory::fromProperties($objectOrClass, $filter); |
@@ -33,7 +33,7 @@ |
||
33 | 33 | $error['field'] ?? '_error', |
34 | 34 | $error['message'], |
35 | 35 | $error['type'] ?? '' |
36 | - ) . PHP_EOL; |
|
36 | + ).PHP_EOL; |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | return $errors; |
@@ -12,7 +12,7 @@ |
||
12 | 12 | class UseRuleSet implements Rule |
13 | 13 | { |
14 | 14 | public function __construct( |
15 | - private object|string $objectOrClass, |
|
15 | + private object | string $objectOrClass, |
|
16 | 16 | private string $property |
17 | 17 | ) { |
18 | 18 | } |
@@ -29,8 +29,7 @@ |
||
29 | 29 | { |
30 | 30 | return |
31 | 31 | $this->isValid($input, $context) ? |
32 | - ErrorReporting::success() : |
|
33 | - (new ErrorReporting)->addError($this->message, $this->getField(), $this); |
|
32 | + ErrorReporting::success() : (new ErrorReporting)->addError($this->message, $this->getField(), $this); |
|
34 | 33 | } |
35 | 34 | |
36 | 35 | protected function className(): string |