@@ -89,7 +89,7 @@ discard block |
||
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 |
||
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 |
@@ -91,8 +91,7 @@ |
||
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 | } |
@@ -93,7 +93,7 @@ discard block |
||
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,16 +111,16 @@ discard block |
||
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 |
121 | 121 | ], $subValue, $config['type'] instanceof ListOfType); |
122 | 122 | |
123 | - if(isset($err['errors'])) { |
|
123 | + if (isset($err['errors'])) { |
|
124 | 124 | $i = 5; |
125 | 125 | } |
126 | 126 | |
@@ -200,10 +200,10 @@ discard block |
||
200 | 200 | $fields = $type->getFields(); |
201 | 201 | if (is_array($value)) { |
202 | 202 | foreach ($value as $key => $subValue) { |
203 | - $config = $fields[$key]->config; |
|
203 | + $config = $fields[$key]->config; |
|
204 | 204 | $error = $this->_validate($config, $subValue); |
205 | 205 | |
206 | - if($error) { |
|
206 | + if ($error) { |
|
207 | 207 | if ($createSubErrors) { |
208 | 208 | $res[UserErrorsType::SUBERRORS_NAME][$key] = $error; |
209 | 209 | } else { |