Passed
Push — master ( 820d88...1764db )
by Max
04:32
created
src/Type/Definition/UserErrorsType.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -191,7 +191,7 @@
 block discarded – undo
191 191
             return $userErrorType;
192 192
         }
193 193
 
194
-        if(count($path) == 1) {
194
+        if (count($path) == 1) {
195 195
             throw new Exception("You must specify at least one 'validate' callback somewhere");
196 196
         }
197 197
 
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -107,8 +107,7 @@
 block discarded – undo
107 107
                     return $value[static::SUBERRORS_NAME] ?? null;
108 108
                 },
109 109
             ];
110
-        }
111
-        else {
110
+        } else {
112 111
             $finalFields += $fields;
113 112
         }
114 113
     }
Please login to merge, or discard this patch.
src/Type/Definition/ValidatedFieldDefinition.php 2 patches
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -169,8 +169,7 @@
 block discarded – undo
169 169
         } catch (ValidateItemsError $e) {
170 170
             if(isset($e->error['suberrors'])) {
171 171
                 $err = $e->error;
172
-            }
173
-            else {
172
+            } else {
174 173
                 $err = [
175 174
                     'error' => $e->error,
176 175
                 ];
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
         if ($arr === []) {
99 99
             return false;
100 100
         }
101
-        return array_keys($arr) !== range(0, count($arr) - 1);
101
+        return array_keys($arr) !== range(0, count($arr)-1);
102 102
     }
103 103
 
104 104
     /**
@@ -114,12 +114,12 @@  discard block
 block discarded – undo
114 114
                 $path[count($path)-1] = $idx;
115 115
                 $newPath              = $path;
116 116
                 $newPath[]            = 0;
117
-                $this->_validateItems($config, $subValue, $newPath, $validate );
117
+                $this->_validateItems($config, $subValue, $newPath, $validate);
118 118
             } else {
119
-                $path[count($path) - 1] = $idx;
119
+                $path[count($path)-1] = $idx;
120 120
                 $err                    = $validate($subValue);
121 121
 
122
-                if(empty($err)) {
122
+                if (empty($err)) {
123 123
                     $wrappedType = $config['type']->getWrappedType(true);
124 124
                     $err = $this->_validate([
125 125
                         'type' => $wrappedType
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
         try {
171 171
             $this->_validateItems($config, $value, [0], $config['validate'] ?? [$this, "_noop"]);
172 172
         } catch (ValidateItemsError $e) {
173
-            if(isset($e->error['suberrors'])) {
173
+            if (isset($e->error['suberrors'])) {
174 174
                 $err = $e->error;
175 175
             }
176 176
             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
                     $createSubErrors ? $res[UserErrorsType::SUBERRORS_NAME][$key] = $error : $res[$key] = $error;
210 210
                 }
211 211
             }
Please login to merge, or discard this patch.