@@ -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 | } |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | 'name' => $name, |
| 68 | 68 | 'resolve' => function ($value, $args1, $context, $info) use ($config, $args, $validFieldName, $resultFieldName) { |
| 69 | 69 | // validate inputs |
| 70 | - $config['type'] = new InputObjectType([ |
|
| 70 | + $config['type'] = new InputObjectType([ |
|
| 71 | 71 | 'name'=>'', |
| 72 | 72 | 'fields' => $args, |
| 73 | 73 | ]); |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | if ($arr === []) { |
| 93 | 93 | return false; |
| 94 | 94 | } |
| 95 | - return array_keys($arr) !== range(0, count($arr) - 1); |
|
| 95 | + return array_keys($arr) !== range(0, count($arr)-1); |
|
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | /** |
@@ -110,10 +110,10 @@ discard block |
||
| 110 | 110 | $newPath[] = 0; |
| 111 | 111 | $this->_validateItems($config, $subValue, $newPath, $validate); |
| 112 | 112 | } else { |
| 113 | - $path[count($path) - 1] = $idx; |
|
| 113 | + $path[count($path)-1] = $idx; |
|
| 114 | 114 | $err = $validate($subValue); |
| 115 | 115 | |
| 116 | - if(empty($err)) { |
|
| 116 | + if (empty($err)) { |
|
| 117 | 117 | $wrappedType = $config['type']->getWrappedType(true); |
| 118 | 118 | $err = $this->_validate([ |
| 119 | 119 | 'type' => $wrappedType |
@@ -192,7 +192,7 @@ discard block |
||
| 192 | 192 | $fields = $type->getFields(); |
| 193 | 193 | if (is_array($value)) { |
| 194 | 194 | foreach ($value as $key => $subValue) { |
| 195 | - $config = $fields[$key]->config; |
|
| 195 | + $config = $fields[$key]->config; |
|
| 196 | 196 | $res['errors'][$key] = $this->_validate($config, $subValue); |
| 197 | 197 | } |
| 198 | 198 | $res['errors'] = array_filter($res['errors'] ?? []); |