Passed
Pull Request — master (#18)
by Dedipyaman
03:03
created
src/Rule/String/ExactLength.php 1 patch
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -35,14 +35,16 @@
 block discarded – undo
35 35
     {
36 36
         $result = (new StringType())->validate($data);
37 37
 
38
-        if (!$result->isValid())
39
-            return new $result;
38
+        if (!$result->isValid()) {
39
+                    return new $result;
40
+        }
40 41
 
41 42
         if (mb_strlen($data, 'UTF-8') == $this->length) {
42 43
             return new Success();
43
-        }
44
-        else return new Failure(
44
+        } else {
45
+            return new Failure(
45 46
             new RuleError(RuleErrorCode::LENGTH_ERROR,
46 47
                 'The supplied string is not of correct length'));
48
+        }
47 49
     }
48 50
 }
49 51
\ No newline at end of file
Please login to merge, or discard this patch.
src/Type/StringRequired.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -27,8 +27,9 @@
 block discarded – undo
27 27
      */
28 28
     public function __construct(?string $text)
29 29
     {
30
-        if (empty($text))
31
-            throw new EmptyRequiredValue();
30
+        if (empty($text)) {
31
+                    throw new EmptyRequiredValue();
32
+        }
32 33
 
33 34
         $this->value = $text;
34 35
     }
Please login to merge, or discard this patch.
src/Validator/UsernameValidator.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -56,8 +56,9 @@
 block discarded – undo
56 56
             new MaximumLength($this->maxLength));
57 57
 
58 58
         $result = $rule->validate($username);
59
-        if ($result->isValid())
60
-            return new Success();
59
+        if ($result->isValid()) {
60
+                    return new Success();
61
+        }
61 62
         /**
62 63
          * @var Failure $result
63 64
          */
Please login to merge, or discard this patch.