Passed
Pull Request — master (#8)
by Max
04:09
created
src/Type/Definition/UserErrorsType.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
                 },
90 90
             ];
91 91
 
92
-            if($createSubErrors) {
92
+            if ($createSubErrors) {
93 93
                 $fields[$key] = $errType;
94 94
             }
95 95
             else {
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
             return $userErrorType;
197 197
         }
198 198
 
199
-        if(count($path) == 1) {
199
+        if (count($path) == 1) {
200 200
             throw new Exception("You must specify at least one 'validate' callback somewhere");
201 201
         }
202 202
 
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -91,8 +91,7 @@
 block discarded – undo
91 91
 
92 92
             if($createSubErrors) {
93 93
                 $fields[$key] = $errType;
94
-            }
95
-            else {
94
+            } else {
96 95
                 $finalFields[$key] = $errType;
97 96
             }
98 97
         }
Please login to merge, or discard this patch.
src/Type/Definition/ValidatedFieldDefinition.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
         if ($arr === []) {
94 94
             return false;
95 95
         }
96
-        return array_keys($arr) !== range(0, count($arr) - 1);
96
+        return array_keys($arr) !== range(0, count($arr)-1);
97 97
     }
98 98
 
99 99
     /**
@@ -111,10 +111,10 @@  discard block
 block discarded – undo
111 111
                 $newPath[]            = 0;
112 112
                 $this->_validateItems($config, $subValue, $newPath, $validate);
113 113
             } else {
114
-                $path[count($path) - 1] = $idx;
114
+                $path[count($path)-1] = $idx;
115 115
                 $err                    = $validate($subValue);
116 116
 
117
-                if(empty($err)) {
117
+                if (empty($err)) {
118 118
                     $wrappedType = $config['type']->getWrappedType(true);
119 119
                     $err = $this->_validate([
120 120
                         'type' => $wrappedType
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
             try {
169 169
                 $this->_validateItems($config, $value, [0], $config['validate']);
170 170
             } catch (ValidateItemsError $e) {
171
-                if(isset($e->error['suberrors'])) {
171
+                if (isset($e->error['suberrors'])) {
172 172
                     $err = $e->error;
173 173
                 }
174 174
                 else {
@@ -202,10 +202,10 @@  discard block
 block discarded – undo
202 202
         $fields = $type->getFields();
203 203
         if (is_array($value)) {
204 204
             foreach ($value as $key => $subValue) {
205
-                $config                 = $fields[$key]->config;
205
+                $config = $fields[$key]->config;
206 206
                 $error = $this->_validate($config, $subValue);
207 207
 
208
-                if($error) {
208
+                if ($error) {
209 209
                     if ($createSubErrors) {
210 210
                         $res[UserErrorsType::SUBERRORS_NAME][$key] = $error;
211 211
                     } else {
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -170,8 +170,7 @@
 block discarded – undo
170 170
             } catch (ValidateItemsError $e) {
171 171
                 if(isset($e->error['suberrors'])) {
172 172
                     $err = $e->error;
173
-                }
174
-                else {
173
+                } else {
175 174
                     $err = [
176 175
                         'error' => $e->error,
177 176
                     ];
Please login to merge, or discard this patch.