Completed
Push — master ( b843f5...1528d8 )
by Neomerx
03:51
created
src/Rules/Converters/StringToInt.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@
 block discarded – undo
41 41
     public static function execute($value, ContextInterface $context): array
42 42
     {
43 43
         if (is_string($value) === true || is_numeric($value) === true) {
44
-            return static::createSuccessReply((int)$value);
44
+            return static::createSuccessReply((int) $value);
45 45
         }
46 46
 
47 47
         return static::createErrorReply($context, $value, ErrorCodes::IS_INT, Messages::IS_INT, []);
Please login to merge, or discard this patch.
src/Rules/Converters/StringArrayToIntArray.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@
 block discarded – undo
48 48
         if (is_array($value) === true) {
49 49
             foreach ($value as $key => $mightBeString) {
50 50
                 if (is_string($mightBeString) === true || is_numeric($mightBeString) === true) {
51
-                    $result[$key] = (int)$mightBeString;
51
+                    $result[$key] = (int) $mightBeString;
52 52
                 } else {
53 53
                     $reply = static::createErrorReply(
54 54
                         $context,
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
@@ -41,7 +41,7 @@
 block discarded – undo
41 41
     public static function execute($value, ContextInterface $context): array
42 42
     {
43 43
         if (is_string($value) === true || is_numeric($value) === true) {
44
-            return static::createSuccessReply((float)$value);
44
+            return static::createSuccessReply((float) $value);
45 45
         }
46 46
 
47 47
         return static::createErrorReply($context, $value, ErrorCodes::IS_FLOAT, Messages::IS_FLOAT, []);
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
@@ -67,10 +67,10 @@  discard block
 block discarded – undo
67 67
             // 'address1'   => 'Dow 1', // missed required parameter
68 68
             'accepted'      => 'false',
69 69
         ];
70
-        $this->console('Invalid data (errors)' . PHP_EOL);
70
+        $this->console('Invalid data (errors)'.PHP_EOL);
71 71
         $validator->validate($invalidInput);
72 72
         $this->printErrors($validator->getErrors());
73
-        $this->console('Invalid data (captures)' . PHP_EOL);
73
+        $this->console('Invalid data (captures)'.PHP_EOL);
74 74
         $this->printCaptures($validator->getCaptures());
75 75
 
76 76
         // Check with valid data
@@ -83,10 +83,10 @@  discard block
 block discarded – undo
83 83
             'address2'      => null,
84 84
             'accepted'      => 'true',
85 85
         ];
86
-        $this->console(PHP_EOL . 'Valid data (errors)' . PHP_EOL);
86
+        $this->console(PHP_EOL.'Valid data (errors)'.PHP_EOL);
87 87
         $validator->validate($validInput);
88 88
         $this->printErrors($validator->getErrors());
89
-        $this->console('Valid data (captures)' . PHP_EOL);
89
+        $this->console('Valid data (captures)'.PHP_EOL);
90 90
         $this->printCaptures($validator->getCaptures());
91 91
 
92 92
         // The output would be
@@ -134,11 +134,11 @@  discard block
 block discarded – undo
134 134
             $context    = $error->getMessageParameters();
135 135
             $errorMsg   = MessageFormatter::formatMessage('en', $errorMsg, $context !== null ? $context : []);
136 136
 
137
-            $this->console("$entry failed for `$paramValue` with: $errorMsg" . PHP_EOL);
137
+            $this->console("$entry failed for `$paramValue` with: $errorMsg".PHP_EOL);
138 138
         }
139 139
 
140 140
         if ($hasErrors === false) {
141
-            $this->console('No errors' . PHP_EOL);
141
+            $this->console('No errors'.PHP_EOL);
142 142
         }
143 143
     }
144 144
 
@@ -155,11 +155,11 @@  discard block
 block discarded – undo
155 155
             $hasCaptures = true;
156 156
             $type        = gettype($value);
157 157
             $value       = $value instanceof DateTimeInterface ? $value->format(DateTime::ISO8601) : $value;
158
-            $this->console("`$name` = `$value` ($type)" . PHP_EOL);
158
+            $this->console("`$name` = `$value` ($type)".PHP_EOL);
159 159
         }
160 160
 
161 161
         if ($hasCaptures === false) {
162
-            $this->console('No captures' . PHP_EOL);
162
+            $this->console('No captures'.PHP_EOL);
163 163
         }
164 164
     }
165 165
 
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
@@ -45,8 +45,7 @@
 block discarded – undo
45 45
         $isValidDeliveryDate = $value instanceof DateTimeInterface === true && $value >= $from && $value <= $to;
46 46
 
47 47
         return $isValidDeliveryDate === true ?
48
-            static::createSuccessReply($value) :
49
-            static::createErrorReply(
48
+            static::createSuccessReply($value) : static::createErrorReply(
50 49
                 $context,
51 50
                 $value,
52 51
                 Errors::IS_DELIVERY_DATE,
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
@@ -41,8 +41,7 @@
 block discarded – undo
41 41
         $idExists = is_int($value) === true && $value < 3;
42 42
 
43 43
         return $idExists === true ?
44
-            static::createSuccessReply($value) :
45
-            static::createErrorReply(
44
+            static::createSuccessReply($value) : static::createErrorReply(
46 45
                 $context,
47 46
                 $value,
48 47
                 Errors::IS_VALID_SKU,
Please login to merge, or discard this patch.
sample/main.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@
 block discarded – undo
2 2
 
3 3
 namespace Sample;
4 4
 
5
-require_once __DIR__ . '/vendor/autoload.php';
5
+require_once __DIR__.'/vendor/autoload.php';
6 6
 
7 7
 /**
8 8
  * Copyright 2015-2019 [email protected]
Please login to merge, or discard this patch.