@@ -66,8 +66,9 @@ |
||
| 66 | 66 | |
| 67 | 67 | $result = $rule->validate($name); |
| 68 | 68 | |
| 69 | - if ($result->isValid()) |
|
| 70 | - return new Success(); |
|
| 69 | + if ($result->isValid()) { |
|
| 70 | + return new Success(); |
|
| 71 | + } |
|
| 71 | 72 | /** |
| 72 | 73 | * @var Failure $result |
| 73 | 74 | */ |
@@ -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 |