Passed
Push — master ( 470ad5...955b74 )
by Dedipyaman
02:14
created
src/Rule/Number/Equals.php 1 patch
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -36,11 +36,13 @@
 block discarded – undo
36 36
     {
37 37
         $numericResult = (new NumericType())->validate($value);
38 38
 
39
-        if (!$numericResult->isValid())
40
-            return new $numericResult;
39
+        if (!$numericResult->isValid()) {
40
+                    return new $numericResult;
41
+        }
41 42
 
42
-        if ($value == $this->expected)
43
-            return new Success();
43
+        if ($value == $this->expected) {
44
+                    return new Success();
45
+        }
44 46
 
45 47
         return new Failure(new RuleError(RuleErrorCode::LESS_THAN_MINIMUM,
46 48
             'The supplied number is less than the expectedimum value'));
Please login to merge, or discard this patch.
src/Rule/Number/Minimum.php 1 patch
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -36,11 +36,13 @@
 block discarded – undo
36 36
     {
37 37
         $numericResult = (new NumericType())->validate($value);
38 38
 
39
-        if (!$numericResult->isValid())
40
-            return new $numericResult;
39
+        if (!$numericResult->isValid()) {
40
+                    return new $numericResult;
41
+        }
41 42
 
42
-        if ($value >= $this->min)
43
-            return new Success();
43
+        if ($value >= $this->min) {
44
+                    return new Success();
45
+        }
44 46
 
45 47
         return new Failure(new RuleError(RuleErrorCode::LESS_THAN_MINIMUM,
46 48
             'The supplied number is less than the minimum value'));
Please login to merge, or discard this patch.
src/Rule/Number/Negative.php 1 patch
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -27,11 +27,13 @@
 block discarded – undo
27 27
     {
28 28
         $numericResult = (new NumericType())->validate($value);
29 29
 
30
-        if (!$numericResult->isValid())
31
-            return new $numericResult;
30
+        if (!$numericResult->isValid()) {
31
+                    return new $numericResult;
32
+        }
32 33
 
33
-        if ($value < 0)
34
-            return new Success();
34
+        if ($value < 0) {
35
+                    return new Success();
36
+        }
35 37
 
36 38
         return new Failure(new RuleError(RuleErrorCode::NOT_NEGATIVE, 'The supplied number is not negative'));
37 39
     }
Please login to merge, or discard this patch.
src/Rule/Number/Maximum.php 1 patch
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -36,11 +36,13 @@
 block discarded – undo
36 36
     {
37 37
         $numericResult = (new NumericType())->validate($value);
38 38
 
39
-        if (!$numericResult->isValid())
40
-            return new $numericResult;
39
+        if (!$numericResult->isValid()) {
40
+                    return new $numericResult;
41
+        }
41 42
 
42
-        if ($value <= $this->max)
43
-            return new Success();
43
+        if ($value <= $this->max) {
44
+                    return new Success();
45
+        }
44 46
 
45 47
         return new Failure(new RuleError(RuleErrorCode::EXCEEDS_MAXIMUM, 'The supplied number exceeds the maximum value'));
46 48
     }
Please login to merge, or discard this patch.
src/Rule/Number/Positive.php 1 patch
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -27,11 +27,13 @@
 block discarded – undo
27 27
     {
28 28
         $numericResult = (new NumericType())->validate($value);
29 29
 
30
-        if (!$numericResult->isValid())
31
-            return new $numericResult;
30
+        if (!$numericResult->isValid()) {
31
+                    return new $numericResult;
32
+        }
32 33
 
33
-        if ($value > 0)
34
-            return new Success();
34
+        if ($value > 0) {
35
+                    return new Success();
36
+        }
35 37
 
36 38
         return new Failure(new RuleError(RuleErrorCode::NOT_POSITIVE, 'The supplied number is not positive'));
37 39
     }
Please login to merge, or discard this patch.
src/Rule/Primitive/StringType.php 1 patch
Braces   +5 added lines, -4 removed lines patch added patch discarded remove patch
@@ -22,9 +22,10 @@
 block discarded – undo
22 22
 {
23 23
     public function validate($data): Result
24 24
     {
25
-        if (is_string($data))
26
-            return new Success();
27
-        else
28
-            return new Failure(new RuleError(RuleErrorCode::NOT_STRING, 'Input value is not a string'));
25
+        if (is_string($data)) {
26
+                    return new Success();
27
+        } else {
28
+                    return new Failure(new RuleError(RuleErrorCode::NOT_STRING, 'Input value is not a string'));
29
+        }
29 30
     }
30 31
 }
31 32
\ No newline at end of file
Please login to merge, or discard this patch.
src/Rule/CharType/AlphaNumeric.php 1 patch
Braces   +8 added lines, -6 removed lines patch added patch discarded remove patch
@@ -27,12 +27,14 @@
 block discarded – undo
27 27
     {
28 28
         $result = (new StringType())->validate($data);
29 29
 
30
-        if (!$result->isValid())
31
-            return new $result;
30
+        if (!$result->isValid()) {
31
+                    return new $result;
32
+        }
32 33
 
33
-        if (ctype_alnum(str_replace($this->allowedSpecialChars, '', $data)))
34
-            return new Success();
35
-        else
36
-            return new Failure(new RuleError(RuleErrorCode::NOT_ALNUM, 'String is not Alphanumeric.'));
34
+        if (ctype_alnum(str_replace($this->allowedSpecialChars, '', $data))) {
35
+                    return new Success();
36
+        } else {
37
+                    return new Failure(new RuleError(RuleErrorCode::NOT_ALNUM, 'String is not Alphanumeric.'));
38
+        }
37 39
     }
38 40
 }
39 41
\ No newline at end of file
Please login to merge, or discard this patch.
src/Rule/CharType/Alpha.php 1 patch
Braces   +8 added lines, -6 removed lines patch added patch discarded remove patch
@@ -26,12 +26,14 @@
 block discarded – undo
26 26
     {
27 27
         $result = (new StringType())->validate($data);
28 28
 
29
-        if (!$result->isValid())
30
-            return new $result;
29
+        if (!$result->isValid()) {
30
+                    return new $result;
31
+        }
31 32
 
32
-        if (ctype_alpha(str_replace($this->allowedSpecialChars, '', $data)))
33
-            return new Success();
34
-        else
35
-            return new Failure(new RuleError(RuleErrorCode::NOT_ALPHA, 'String is not Alphabetic.'));
33
+        if (ctype_alpha(str_replace($this->allowedSpecialChars, '', $data))) {
34
+                    return new Success();
35
+        } else {
36
+                    return new Failure(new RuleError(RuleErrorCode::NOT_ALPHA, 'String is not Alphabetic.'));
37
+        }
36 38
     }
37 39
 }
38 40
\ No newline at end of file
Please login to merge, or discard this patch.
src/Rule/CharType/IntegerNumber.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
         $numericResult = (new NumericType())->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();
Please login to merge, or discard this patch.