@@ -23,9 +23,10 @@ |
||
23 | 23 | { |
24 | 24 | public function validate($data): Result |
25 | 25 | { |
26 | - if (is_numeric($data)) |
|
27 | - return new Success(); |
|
28 | - else |
|
29 | - return new Failure(new RuleError(RuleErrorCode::NOT_NUMERIC, 'Input value is not numeric')); |
|
26 | + if (is_numeric($data)) { |
|
27 | + return new Success(); |
|
28 | + } else { |
|
29 | + return new Failure(new RuleError(RuleErrorCode::NOT_NUMERIC, 'Input value is not numeric')); |
|
30 | + } |
|
30 | 31 | } |
31 | 32 | } |
32 | 33 | \ No newline at end of file |
@@ -27,8 +27,9 @@ |
||
27 | 27 | { |
28 | 28 | $numericResult = (new Numeric())->validate($value); |
29 | 29 | |
30 | - if (!$numericResult->isValid()) |
|
31 | - return new $numericResult; |
|
30 | + if (!$numericResult->isValid()) { |
|
31 | + return new $numericResult; |
|
32 | + } |
|
32 | 33 | |
33 | 34 | if (filter_var(str_replace($this->allowedSpecialChars, '', $value), FILTER_VALIDATE_FLOAT) !== false) { |
34 | 35 | return new Success(); |
@@ -27,8 +27,9 @@ |
||
27 | 27 | { |
28 | 28 | $numericResult = (new Numeric())->validate($value); |
29 | 29 | |
30 | - if (!$numericResult->isValid()) |
|
31 | - return new $numericResult; |
|
30 | + if (!$numericResult->isValid()) { |
|
31 | + return new $numericResult; |
|
32 | + } |
|
32 | 33 | |
33 | 34 | if (filter_var(str_replace($this->allowedSpecialChars, '', $value), FILTER_VALIDATE_INT) !== false) { |
34 | 35 | return new Success(); |