Completed
Push — master ( de4379...69572d )
by Neomerx
09:55
created
src/Rules/Converters/StringArrayToIntArray.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@
 block discarded – undo
42 42
         if (is_array($value) === true) {
43 43
             foreach ($value as $key => $mightBeString) {
44 44
                 if (is_string($mightBeString) === true || is_numeric($mightBeString) === true) {
45
-                    $result[$key] = (int)$mightBeString;
45
+                    $result[$key] = (int) $mightBeString;
46 46
                 } else {
47 47
                     $reply = static::createErrorReply($context, $mightBeString, ErrorCodes::IS_STRING);
48 48
                     break;
Please login to merge, or discard this patch.
src/Rules/Converters/StringToFloat.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@
 block discarded – undo
36 36
     public static function execute($value, ContextInterface $context): array
37 37
     {
38 38
         if (is_string($value) === true || is_numeric($value) === true) {
39
-            return static::createSuccessReply((float)$value);
39
+            return static::createSuccessReply((float) $value);
40 40
         }
41 41
 
42 42
         return static::createErrorReply($context, $value, ErrorCodes::IS_FLOAT);
Please login to merge, or discard this patch.
src/Rules/Converters/StringToInt.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@
 block discarded – undo
36 36
     public static function execute($value, ContextInterface $context): array
37 37
     {
38 38
         if (is_string($value) === true || is_numeric($value) === true) {
39
-            return static::createSuccessReply((int)$value);
39
+            return static::createSuccessReply((int) $value);
40 40
         }
41 41
 
42 42
         return static::createErrorReply($context, $value, ErrorCodes::IS_INT);
Please login to merge, or discard this patch.
src/Rules/Generic/Enum.php 1 patch
Spacing   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -56,7 +56,6 @@
 block discarded – undo
56 56
         $isOk   = in_array($value, $values);
57 57
 
58 58
         return $isOk === true ?
59
-            static::createSuccessReply($value) :
60
-            static::createErrorReply($context, $value, ErrorCodes::INVALID_VALUE);
59
+            static::createSuccessReply($value) : static::createErrorReply($context, $value, ErrorCodes::INVALID_VALUE);
61 60
     }
62 61
 }
Please login to merge, or discard this patch.
src/Rules/Generic/Filter.php 1 patch
Spacing   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -73,7 +73,6 @@
 block discarded – undo
73 73
         $output = filter_var($value, $filterId, $filterOptions);
74 74
 
75 75
         return $output !== false ?
76
-            static::createSuccessReply($output) :
77
-            static::createErrorReply($context, $value, $errorCode, [$filterId, $filterOptions]);
76
+            static::createSuccessReply($output) : static::createErrorReply($context, $value, $errorCode, [$filterId, $filterOptions]);
78 77
     }
79 78
 }
Please login to merge, or discard this patch.
sample/Application.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -66,10 +66,10 @@  discard block
 block discarded – undo
66 66
             // 'address1'   => 'Dow 1', // missed required parameter
67 67
             'accepted'      => 'false',
68 68
         ];
69
-        $this->console('Invalid data (errors)' . PHP_EOL);
69
+        $this->console('Invalid data (errors)'.PHP_EOL);
70 70
         $validator->validate($invalidInput);
71 71
         $this->printErrors($validator->getErrors());
72
-        $this->console('Invalid data (captures)' . PHP_EOL);
72
+        $this->console('Invalid data (captures)'.PHP_EOL);
73 73
         $this->printCaptures($validator->getCaptures());
74 74
 
75 75
         // Check with valid data
@@ -82,10 +82,10 @@  discard block
 block discarded – undo
82 82
             'address2'      => null,
83 83
             'accepted'      => 'true',
84 84
         ];
85
-        $this->console(PHP_EOL . 'Valid data (errors)' . PHP_EOL);
85
+        $this->console(PHP_EOL.'Valid data (errors)'.PHP_EOL);
86 86
         $validator->validate($validInput);
87 87
         $this->printErrors($validator->getErrors());
88
-        $this->console('Valid data (captures)' . PHP_EOL);
88
+        $this->console('Valid data (captures)'.PHP_EOL);
89 89
         $this->printCaptures($validator->getCaptures());
90 90
 
91 91
         // The output would be
@@ -133,11 +133,11 @@  discard block
 block discarded – undo
133 133
             $context    = $error->getMessageContext();
134 134
             $errorMsg   = MessageFormatter::formatMessage('en', $errorMsg, $context !== null ? $context : []);
135 135
     
136
-            $this->console("$entry failed for `$paramValue` with: $errorMsg" . PHP_EOL);
136
+            $this->console("$entry failed for `$paramValue` with: $errorMsg".PHP_EOL);
137 137
         }
138 138
 
139 139
         if ($hasErrors === false) {
140
-            $this->console('No errors' . PHP_EOL);
140
+            $this->console('No errors'.PHP_EOL);
141 141
         }
142 142
     }
143 143
 
@@ -154,11 +154,11 @@  discard block
 block discarded – undo
154 154
             $hasCaptures = true;
155 155
             $type        = gettype($value);
156 156
             $value       = $value instanceof DateTimeInterface ? $value->format(DateTime::ISO8601) : $value;
157
-            $this->console("`$name` = `$value` ($type)" . PHP_EOL);
157
+            $this->console("`$name` = `$value` ($type)".PHP_EOL);
158 158
         }
159 159
 
160 160
         if ($hasCaptures === false) {
161
-            $this->console('No captures' . PHP_EOL);
161
+            $this->console('No captures'.PHP_EOL);
162 162
         }
163 163
     }
164 164
 
Please login to merge, or discard this patch.
sample/Validation/Rules.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@
 block discarded – undo
39 39
      */
40 40
     public static function amount(int $max): RuleInterface
41 41
     {
42
-        assert ($max > 0);
42
+        assert($max > 0);
43 43
 
44 44
         return static::stringToInt(static::between(1, $max));
45 45
     }
Please login to merge, or discard this patch.
sample/Validation/IsDeliveryDateRule.php 1 patch
Spacing   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -40,7 +40,6 @@
 block discarded – undo
40 40
             $value <= new DateTime('+5 days');
41 41
 
42 42
         return $isValidDeliveryDate === true ?
43
-            static::createSuccessReply($value) :
44
-            static::createErrorReply($context, $value, Errors::IS_DELIVERY_DATE);
43
+            static::createSuccessReply($value) : static::createErrorReply($context, $value, Errors::IS_DELIVERY_DATE);
45 44
     }
46 45
 }
Please login to merge, or discard this patch.
sample/Validation/IsSkuRule.php 1 patch
Spacing   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -35,7 +35,6 @@
 block discarded – undo
35 35
         $idExists = is_int($value) === true && $value < 3;
36 36
 
37 37
         return $idExists === true ?
38
-            static::createSuccessReply($value) :
39
-            static::createErrorReply($context, $value, Errors::IS_VALID_SKU);
38
+            static::createSuccessReply($value) : static::createErrorReply($context, $value, Errors::IS_VALID_SKU);
40 39
     }
41 40
 }
Please login to merge, or discard this patch.