@@ -19,7 +19,7 @@ |
||
19 | 19 | |
20 | 20 | protected function setStopSign(int $stopSign): void |
21 | 21 | { |
22 | - if (! in_array($stopSign, [Stoppable::DONT_STOP, Stoppable::ALL, Stoppable::SAME_FIELD])) { |
|
22 | + if (!in_array($stopSign, [Stoppable::DONT_STOP, Stoppable::ALL, Stoppable::SAME_FIELD])) { |
|
23 | 23 | throw new InvalidArgumentException(sprintf('Invalid stop sign (%s)', $stopSign)); |
24 | 24 | } |
25 | 25 |
@@ -20,7 +20,7 @@ |
||
20 | 20 | use BelongsToField, StopOnFailure, Priority; |
21 | 21 | |
22 | 22 | public function __construct( |
23 | - private object|string $objectOrClass, |
|
23 | + private object | string $objectOrClass, |
|
24 | 24 | private string $property, |
25 | 25 | int $stopOnFailure = Stoppable::DONT_STOP, |
26 | 26 | int $priority = Prioritable::LOWEST_PRIORITY |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | * @param Rule|RuleSet ...$rules |
41 | 41 | * @return $this |
42 | 42 | */ |
43 | - public function field(string $field, Rule|RuleSet ...$rules): self |
|
43 | + public function field(string $field, Rule | RuleSet ...$rules): self |
|
44 | 44 | { |
45 | 45 | $ruleSet = $this->ruleSets[$field] ?? RuleSet::of($field); |
46 | 46 | $this->ruleSets[$field] = $ruleSet->add(...$rules); |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | $errorReporting = new ErrorReporting; |
54 | 54 | foreach ($this->ruleSets as $field => $fieldRuleSet) { |
55 | 55 | $fieldRuleSet = $fieldRuleSet->withField($field); |
56 | - if (! $this->shouldValidate($fieldRuleSet, $data)) { |
|
56 | + if (!$this->shouldValidate($fieldRuleSet, $data)) { |
|
57 | 57 | continue; |
58 | 58 | } |
59 | 59 | |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | * @return static |
119 | 119 | * @throws ReflectionException if the class does not exist |
120 | 120 | */ |
121 | - public static function fromProperties(string|object $objectOrClass, ?int $filter = null): self |
|
121 | + public static function fromProperties(string | object $objectOrClass, ?int $filter = null): self |
|
122 | 122 | { |
123 | 123 | $instance = new self; |
124 | 124 | $instance->ruleSets = RuleSet::fromProperties($objectOrClass, $filter); |
@@ -8,7 +8,7 @@ |
||
8 | 8 | { |
9 | 9 | protected static function sortByPriority(array &$haystack): void |
10 | 10 | { |
11 | - uasort($haystack, function ($a, $b) { |
|
11 | + uasort($haystack, function($a, $b) { |
|
12 | 12 | $prorityOfA = $a instanceof Prioritable ? $a->getPriority() : Prioritable::LOWEST_PRIORITY; |
13 | 13 | $prorityOfB = $b instanceof Prioritable ? $b->getPriority() : Prioritable::LOWEST_PRIORITY; |
14 | 14 |