Passed
Pull Request — master (#9)
by Max
03:49
created
src/Type/Definition/UserErrorsType.php 2 patches
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.
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -54,8 +54,8 @@
 block discarded – undo
54 54
     protected function _getType($config) {
55 55
         $type = $config['type'];
56 56
         if (is_callable($type)) {
57
-        	$type = $type();
58
-		}
57
+            $type = $type();
58
+        }
59 59
 
60 60
         if ($type instanceof WrappingType) {
61 61
             $type = $type->getWrappedType(true);
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.
Indentation   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -36,8 +36,8 @@  discard block
 block discarded – undo
36 36
 
37 37
         parent::__construct([
38 38
             'type' => function() use($name, $config, $args) {
39
-				return static::_create($name, $args, $config);
40
-			},
39
+                return static::_create($name, $args, $config);
40
+            },
41 41
             'args' => $args,
42 42
             'name' => $name,
43 43
             'resolve' => function ($value, $args1, $context, $info) use ($config, $args) {
@@ -62,33 +62,33 @@  discard block
 block discarded – undo
62 62
     }
63 63
 
64 64
     protected function _create($name, $args, $config) {
65
-		return UserErrorsType::create([
66
-			'errorCodes' => $config['errorCodes'] ?? null,
67
-			'isRoot' => true,
68
-			'fields' => [
69
-				$this->resultFieldName => [
70
-					'type' => $config['type'],
71
-					'description' => 'The payload, if any',
72
-					'resolve' => static function ($value) {
73
-						return $value['result'] ?? null;
74
-					},
75
-				],
76
-				$this->validFieldName => [
77
-					'type' => Type::nonNull(Type::boolean()),
78
-					'description' => 'Whether all validation passed. True for yes, false for no.',
79
-					'resolve' => static function ($value) {
80
-						return $value['valid'];
81
-					},
82
-				],
83
-			],
84
-			'validate' => $config['validate'] ?? null,
85
-			'type' => new InputObjectType([
86
-				'fields' => $args,
87
-				'name' => '',
88
-			]),
89
-			'typeSetter' => $config['typeSetter'] ?? null,
90
-		], [$name], false, ucfirst($name) . 'Result');
91
-	}
65
+        return UserErrorsType::create([
66
+            'errorCodes' => $config['errorCodes'] ?? null,
67
+            'isRoot' => true,
68
+            'fields' => [
69
+                $this->resultFieldName => [
70
+                    'type' => $config['type'],
71
+                    'description' => 'The payload, if any',
72
+                    'resolve' => static function ($value) {
73
+                        return $value['result'] ?? null;
74
+                    },
75
+                ],
76
+                $this->validFieldName => [
77
+                    'type' => Type::nonNull(Type::boolean()),
78
+                    'description' => 'Whether all validation passed. True for yes, false for no.',
79
+                    'resolve' => static function ($value) {
80
+                        return $value['valid'];
81
+                    },
82
+                ],
83
+            ],
84
+            'validate' => $config['validate'] ?? null,
85
+            'type' => new InputObjectType([
86
+                'fields' => $args,
87
+                'name' => '',
88
+            ]),
89
+            'typeSetter' => $config['typeSetter'] ?? null,
90
+        ], [$name], false, ucfirst($name) . 'Result');
91
+    }
92 92
 
93 93
     private function _noop($value) {
94 94
         // this is just a no-op validation function to fallback to when no validation function is provided
Please login to merge, or discard this patch.