@@ -21,9 +21,10 @@ |
||
| 21 | 21 | { |
| 22 | 22 | if (mb_strlen($data, 'UTF-8') <= $this->maxLength) { |
| 23 | 23 | return new Success(); |
| 24 | - } |
|
| 25 | - else return new Failure( |
|
| 24 | + } else { |
|
| 25 | + return new Failure( |
|
| 26 | 26 | new RuleError(RuleErrorCode::LENGTH_ERROR, |
| 27 | 27 | 'The supplied string is too long')); |
| 28 | + } |
|
| 28 | 29 | } |
| 29 | 30 | } |
| 30 | 31 | \ No newline at end of file |
@@ -20,9 +20,10 @@ |
||
| 20 | 20 | { |
| 21 | 21 | if (mb_strlen($data, 'UTF-8') >= $this->minLength) { |
| 22 | 22 | return new Result\Success(); |
| 23 | - } |
|
| 24 | - else return new Result\Failure( |
|
| 23 | + } else { |
|
| 24 | + return new Result\Failure( |
|
| 25 | 25 | new RuleError(RuleErrorCode::LENGTH_ERROR, |
| 26 | 26 | 'The supplied string is too short')); |
| 27 | + } |
|
| 27 | 28 | } |
| 28 | 29 | } |
| 29 | 30 | \ No newline at end of file |
@@ -34,9 +34,10 @@ |
||
| 34 | 34 | { |
| 35 | 35 | if (mb_strlen($data, 'UTF-8') >= $this->length) { |
| 36 | 36 | return new Success(); |
| 37 | - } |
|
| 38 | - else return new Failure( |
|
| 37 | + } else { |
|
| 38 | + return new Failure( |
|
| 39 | 39 | new RuleError(RuleErrorCode::LENGTH_ERROR, |
| 40 | 40 | 'The supplied string is not of correct length')); |
| 41 | + } |
|
| 41 | 42 | } |
| 42 | 43 | } |
| 43 | 44 | \ No newline at end of file |