Passed
Pull Request — master (#1)
by Max
05:09
created
tests/Type/UserErrorsType/ScalarTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@
 block discarded – undo
37 37
     {
38 38
         $type = new UserErrorsType([
39 39
             'errorCodes' => ['invalidColor'],
40
-            'validate' => static function ($value) {
40
+            'validate' => static function($value) {
41 41
                 return 0;
42 42
             },
43 43
             'type' => new IDType(['name' => 'Color']),
Please login to merge, or discard this patch.
tests/Type/ValidatedFieldDefinition/ListOfScalarValidationTest.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
             'query' => $this->query,
32 32
             'mutation' => new ObjectType([
33 33
                 'name' => 'Mutation',
34
-                'fields' => static function () {
34
+                'fields' => static function() {
35 35
                     return [
36 36
                         'setPhoneNumbers' => new ValidatedFieldDefinition([
37 37
                             'name' => 'setPhoneNumbers',
@@ -40,20 +40,20 @@  discard block
 block discarded – undo
40 40
                                 'phoneNumbers' => [
41 41
                                     'type' => Type::listOf(Type::listOf(Type::string())),
42 42
                                     'errorCodes' => ['maxNumExceeded'],
43
-                                    'validate' => static function (array $phoneNumbers) {
43
+                                    'validate' => static function(array $phoneNumbers) {
44 44
                                         if (count($phoneNumbers) > 2) {
45 45
                                             return ['maxNumExceeded', 'You may not submit more than 2 lists of phone numbers'];
46 46
                                         }
47 47
                                         return 0;
48 48
                                     },
49 49
                                     'suberrorCodes' => ['invalidPhoneNumber'],
50
-                                    'validateItem' => static function ($phoneNumber) {
50
+                                    'validateItem' => static function($phoneNumber) {
51 51
                                         $res = preg_match('/^[0-9\-]+$/', $phoneNumber) === 1;
52
-                                        return ! $res ? ['invalidPhoneNumber', 'That does not seem to be a valid phone number'] : 0;
52
+                                        return !$res ? ['invalidPhoneNumber', 'That does not seem to be a valid phone number'] : 0;
53 53
                                     },
54 54
                                 ],
55 55
                             ],
56
-                            'resolve' => static function (array $phoneNumbers, $args) : bool {
56
+                            'resolve' => static function(array $phoneNumbers, $args) : bool {
57 57
                                 // ...
58 58
                                 // stash them somewhere
59 59
                                 // ...
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
                             [
111 111
                                 'suberrors' =>
112 112
 	                                [
113
-	                                    'path' => [0,1],
113
+	                                    'path' => [0, 1],
114 114
 	                                    'code' => 'invalidPhoneNumber',
115 115
 	                                ]
116 116
                             ],
@@ -164,18 +164,18 @@  discard block
 block discarded – undo
164 164
 
165 165
         static::assertEmpty($res->errors);
166 166
         static::assertEquals(
167
-	        array (
167
+	        array(
168 168
 		        'valid' => false,
169 169
 		        'suberrors' =>
170
-			        array (
170
+			        array(
171 171
 				        'phoneNumbers' =>
172
-					        array (
172
+					        array(
173 173
 						        'code' => NULL,
174 174
 						        'msg' => NULL,
175 175
 						        'suberrors' =>
176
-							        array (
176
+							        array(
177 177
 								        'path' =>
178
-									        array (
178
+									        array(
179 179
 										        0 => 1,
180 180
 										        1 => 1,
181 181
 									        ),
Please login to merge, or discard this patch.
tests/Type/ValidatedFieldDefinition/ListOfInputObjectValidationTest.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
                 'title' => [
63 63
                     'type' => Type::string(),
64 64
                     'description' => 'Enter a book title, no more than 10 characters in length',
65
-                    'validate' => static function (string $title) {
65
+                    'validate' => static function(string $title) {
66 66
                         if (strlen($title) > 10) {
67 67
                             return [1, 'book title must be less than 10 chaacters'];
68 68
                         }
@@ -76,8 +76,8 @@  discard block
 block discarded – undo
76 76
                         'unknownAuthor',
77 77
                         'authorDeceased',
78 78
                     ],
79
-                    'validate' => function (string $authorId) {
80
-                        if (! isset($this->data['people'][$authorId])) {
79
+                    'validate' => function(string $authorId) {
80
+                        if (!isset($this->data['people'][$authorId])) {
81 81
                             return ['unknownAuthor', 'We have no record of that author'];
82 82
                         }
83 83
                         return 0;
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
             'query' => $this->query,
93 93
             'mutation' => new ObjectType([
94 94
                 'name' => 'Mutation',
95
-                'fields' => function () {
95
+                'fields' => function() {
96 96
                     return [
97 97
                         'updateBooks' => new ValidatedFieldDefinition([
98 98
                             'name' => 'updateBooks',
@@ -104,12 +104,12 @@  discard block
 block discarded – undo
104 104
                         	            $i = 5;
105 105
 	                                },
106 106
 	                                'validateItem' => static function($book) {
107
-                        	            $res = isset($book['author']) || isset($book['title']) ? 0: 1;
107
+                        	            $res = isset($book['author']) || isset($book['title']) ? 0 : 1;
108 108
                         	            return $res;
109 109
 	                                }
110 110
                                 ],
111 111
                             ],
112
-                            'resolve' => static function ($value) : bool {
112
+                            'resolve' => static function($value) : bool {
113 113
                                 // ...
114 114
                                 // do update
115 115
                                 // ...
@@ -169,21 +169,21 @@  discard block
 block discarded – undo
169 169
 	    static::assertEmpty($res->errors);
170 170
 
171 171
         static::assertEquals(
172
-	        array (
172
+	        array(
173 173
 		        'valid' => false,
174 174
 		        'result' => NULL,
175 175
 		        'suberrors' =>
176
-			        array (
176
+			        array(
177 177
 				        'bookAttributes' =>
178
-					        array (
178
+					        array(
179 179
 						        'code' => NULL,
180 180
 						        'msg' => NULL,
181 181
 						        'suberrors' =>
182
-							        array (
182
+							        array(
183 183
 								        'code' => 1,
184 184
 								        'msg' => '',
185 185
 								        'path' =>
186
-									        array (
186
+									        array(
187 187
 										        0 => 1,
188 188
 									        ),
189 189
 							        ),
Please login to merge, or discard this patch.