Completed
Push — master ( 2014f3...a6a027 )
by Alexandr
9s
created
Tests/Schema/ProcessorTest.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 
97 97
     public function testSchemaOperations()
98 98
     {
99
-        $schema    = new Schema([
99
+        $schema = new Schema([
100 100
             'query' => new ObjectType([
101 101
                 'name'   => 'RootQuery',
102 102
                 'fields' => [
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
                                     'args'    => [
110 110
                                         'shorten' => new BooleanType()
111 111
                                     ],
112
-                                    'resolve' => function ($value, $args) {
112
+                                    'resolve' => function($value, $args) {
113 113
                                         return empty($args['shorten']) ? $value : $value;
114 114
                                     }
115 115
                                 ],
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
                                 'code'      => new StringType(),
118 118
                             ]
119 119
                         ]),
120
-                        'resolve' => function ($value, $args) {
120
+                        'resolve' => function($value, $args) {
121 121
                             $data = ['firstName' => 'John', 'code' => '007'];
122 122
                             if (!empty($args['upper'])) {
123 123
                                 foreach ($data as $key => $value) {
@@ -136,13 +136,13 @@  discard block
 block discarded – undo
136 136
                     ],
137 137
                     'randomUser'        => [
138 138
                         'type'    => new TestObjectType(),
139
-                        'resolve' => function () {
139
+                        'resolve' => function() {
140 140
                             return ['invalidField' => 'John'];
141 141
                         }
142 142
                     ],
143 143
                     'invalidValueQuery' => [
144 144
                         'type'    => new TestObjectType(),
145
-                        'resolve' => function () {
145
+                        'resolve' => function() {
146 146
                             return 'stringValue';
147 147
                         }
148 148
                     ],
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
                ->addField(new Field([
168 168
                    'name'    => 'increaseCounter',
169 169
                    'type'    => new IntType(),
170
-                   'resolve' => function ($value, $args, ResolveInfo $info) {
170
+                   'resolve' => function($value, $args, ResolveInfo $info) {
171 171
                        return $this->_counter += $args['amount'];
172 172
                    },
173 173
                    'args'    => [
@@ -179,13 +179,13 @@  discard block
 block discarded – undo
179 179
                ]))->addField(new Field([
180 180
                 'name'    => 'invalidResolveTypeMutation',
181 181
                 'type'    => new NonNullType(new IntType()),
182
-                'resolve' => function () {
182
+                'resolve' => function() {
183 183
                     return null;
184 184
                 }
185 185
             ]))->addField(new Field([
186 186
                 'name'    => 'interfacedMutation',
187 187
                 'type'    => new TestInterfaceType(),
188
-                'resolve' => function () {
188
+                'resolve' => function() {
189 189
                     return ['name' => 'John'];
190 190
                 }
191 191
             ]));
@@ -231,43 +231,43 @@  discard block
 block discarded – undo
231 231
                 'fields' => [
232 232
                     'listQuery'                 => [
233 233
                         'type'    => new ListType(new TestEnumType()),
234
-                        'resolve' => function () {
234
+                        'resolve' => function() {
235 235
                             return 'invalid list';
236 236
                         }
237 237
                     ],
238 238
                     'listEnumQuery'             => [
239 239
                         'type'    => new ListType(new TestEnumType()),
240
-                        'resolve' => function () {
240
+                        'resolve' => function() {
241 241
                             return ['invalid enum'];
242 242
                         }
243 243
                     ],
244 244
                     'invalidEnumQuery'          => [
245 245
                         'type'    => new TestEnumType(),
246
-                        'resolve' => function () {
246
+                        'resolve' => function() {
247 247
                             return 'invalid enum';
248 248
                         }
249 249
                     ],
250 250
                     'enumQuery'                 => [
251 251
                         'type'    => new TestEnumType(),
252
-                        'resolve' => function () {
252
+                        'resolve' => function() {
253 253
                             return 1;
254 254
                         }
255 255
                     ],
256 256
                     'invalidNonNullQuery'       => [
257 257
                         'type'    => new NonNullType(new IntType()),
258
-                        'resolve' => function () {
258
+                        'resolve' => function() {
259 259
                             return null;
260 260
                         }
261 261
                     ],
262 262
                     'invalidNonNullInsideQuery' => [
263 263
                         'type'    => new NonNullType(new IntType()),
264
-                        'resolve' => function () {
264
+                        'resolve' => function() {
265 265
                             return 'hello';
266 266
                         }
267 267
                     ],
268 268
                     'objectQuery'               => [
269 269
                         'type'    => new TestObjectType(),
270
-                        'resolve' => function () {
270
+                        'resolve' => function() {
271 271
                             return ['name' => 'John'];
272 272
                         }
273 273
                     ],
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
                                 'enum'   => new TestEnumType(),
280 280
                             ],
281 281
                         ]),
282
-                        'resolve' => function () {
282
+                        'resolve' => function() {
283 283
                             return [
284 284
                                 'object' => [
285 285
                                     'name' => 'John'
@@ -348,10 +348,10 @@  discard block
 block discarded – undo
348 348
             ]
349 349
         ]);
350 350
 
351
-        $union        = new UnionType([
351
+        $union = new UnionType([
352 352
             'name'        => 'TestUnion',
353 353
             'types'       => [$object1, $object2],
354
-            'resolveType' => function ($object) use ($object1, $object2) {
354
+            'resolveType' => function($object) use ($object1, $object2) {
355 355
                 if (isset($object['id'])) {
356 356
                     return $object1;
357 357
                 }
@@ -362,11 +362,11 @@  discard block
 block discarded – undo
362 362
         $invalidUnion = new UnionType([
363 363
             'name'        => 'TestUnion',
364 364
             'types'       => [$object1, $object2],
365
-            'resolveType' => function ($object) use ($object3) {
365
+            'resolveType' => function($object) use ($object3) {
366 366
                 return $object3;
367 367
             }
368 368
         ]);
369
-        $processor    = new Processor(new Schema([
369
+        $processor = new Processor(new Schema([
370 370
             'query' => new ObjectType([
371 371
                 'name'   => 'RootQuery',
372 372
                 'fields' => [
@@ -375,7 +375,7 @@  discard block
 block discarded – undo
375 375
                         'args'    => [
376 376
                             'type' => ['type' => 'string']
377 377
                         ],
378
-                        'resolve' => function ($value, $args) {
378
+                        'resolve' => function($value, $args) {
379 379
                             if ($args['type'] == 'object1') {
380 380
                                 return [
381 381
                                     'id' => 43
@@ -389,7 +389,7 @@  discard block
 block discarded – undo
389 389
                     ],
390 390
                     'invalidUnion' => [
391 391
                         'type'    => $invalidUnion,
392
-                        'resolve' => function () {
392
+                        'resolve' => function() {
393 393
                             return ['name' => 'name resolved'];
394 394
                         }
395 395
                     ],
Please login to merge, or discard this patch.
Tests/Schema/IntrospectionTest.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
             'description'       => 'latest description',
136 136
             'deprecationReason' => 'for test',
137 137
             'isDeprecated'      => true,
138
-            'resolve'           => function () {
138
+            'resolve'           => function() {
139 139
                 return [
140 140
                     'id'   => 1,
141 141
                     'name' => 'Alex'
@@ -197,8 +197,8 @@  discard block
 block discarded – undo
197 197
                                 ['name' => 'String', 'fields' => null],
198 198
                                 ['name' => '__Schema', 'fields' => [['name' => 'queryType'], ['name' => 'mutationType'], ['name' => 'subscriptionType'], ['name' => 'types'], ['name' => 'directives']]],
199 199
                                 ['name' => '__Type', 'fields' => [['name' => 'name'], ['name' => 'kind'], ['name' => 'description'], ['name' => 'ofType'], ['name' => 'inputFields'], ['name' => 'enumValues'], ['name' => 'fields'], ['name' => 'interfaces'], ['name' => 'possibleTypes']]],
200
-                                ['name' => '__InputValue', 'fields' => [['name' => 'name'], ['name' => 'description'], ['name' => 'type'], ['name' => 'defaultValue'],]],
201
-                                ['name' => '__EnumValue', 'fields' => [['name' => 'name'], ['name' => 'description'], ['name' => 'deprecationReason'], ['name' => 'isDeprecated'],]],
200
+                                ['name' => '__InputValue', 'fields' => [['name' => 'name'], ['name' => 'description'], ['name' => 'type'], ['name' => 'defaultValue'], ]],
201
+                                ['name' => '__EnumValue', 'fields' => [['name' => 'name'], ['name' => 'description'], ['name' => 'deprecationReason'], ['name' => 'isDeprecated'], ]],
202 202
                                 ['name' => 'Boolean', 'fields' => null],
203 203
                                 ['name' => '__Field', 'fields' => [['name' => 'name'], ['name' => 'description'], ['name' => 'isDeprecated'], ['name' => 'deprecationReason'], ['name' => 'type'], ['name' => 'args']]],
204 204
                                 ['name' => '__Subscription', 'fields' => [['name' => 'name']]],
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
                 'id'   => ['type' => new IntType()],
288 288
                 'name' => ['type' => new IntType()],
289 289
             ],
290
-            'resolveType' => function ($type) {
290
+            'resolveType' => function($type) {
291 291
 
292 292
             }
293 293
         ]);
@@ -315,7 +315,7 @@  discard block
 block discarded – undo
315 315
         $unionType = new UnionType([
316 316
             'name'        => 'UnionType',
317 317
             'types'       => [$object1, $object2],
318
-            'resolveType' => function () {
318
+            'resolveType' => function() {
319 319
 
320 320
             }
321 321
         ]);
@@ -326,7 +326,7 @@  discard block
 block discarded – undo
326 326
             'args'    => [
327 327
                 'id' => ['type' => TypeMap::TYPE_INT]
328 328
             ],
329
-            'resolve' => function () {
329
+            'resolve' => function() {
330 330
                 return [
331 331
                     'id'   => 1,
332 332
                     'name' => 'Alex'
@@ -352,7 +352,7 @@  discard block
 block discarded – undo
352 352
                     ]
353 353
                 ])
354 354
             ],
355
-            'resolve' => function () {
355
+            'resolve' => function() {
356 356
                 return null;
357 357
             }
358 358
         ]));
Please login to merge, or discard this patch.
Tests/Schema/SchemaTest.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
             'fields' => [
27 27
                 'currentTime' => [
28 28
                     'type'    => new StringType(),
29
-                    'resolve' => function ($value, $args, $type) {
29
+                    'resolve' => function($value, $args, $type) {
30 30
                         return 'May 5, 9:00am';
31 31
                     },
32 32
                     'args'    => [
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 
56 56
         $this->assertEquals(1, count($schema->getMutationType()->getFields()));
57 57
 
58
-        $schema->addMutationField('changeUser', ['type' => new TestObjectType(), 'resolve' => function () { }]);
58
+        $schema->addMutationField('changeUser', ['type' => new TestObjectType(), 'resolve' => function() { }]);
59 59
         $this->assertEquals(2, count($schema->getMutationType()->getFields()));
60 60
 
61 61
     }
Please login to merge, or discard this patch.
Tests/Library/Type/ScalarTypeTest.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
     {
23 23
         foreach (TypeFactory::getScalarTypesNames() as $typeName) {
24 24
             $scalarType     = TypeFactory::getScalarType($typeName);
25
-            $testDataMethod = 'get' . $typeName . 'TestData';
25
+            $testDataMethod = 'get'.$typeName.'TestData';
26 26
 
27 27
             $this->assertNotEmpty($scalarType->getDescription());
28 28
             $this->assertEquals($scalarType->getKind(), TypeMap::KIND_SCALAR);
@@ -38,9 +38,9 @@  discard block
 block discarded – undo
38 38
                 $this->assertParse($scalarType, $data, $serialized);
39 39
 
40 40
                 if ($isValid) {
41
-                    $this->assertTrue($scalarType->isValidValue($data), $typeName . ' validation for :' . serialize($data));
41
+                    $this->assertTrue($scalarType->isValidValue($data), $typeName.' validation for :'.serialize($data));
42 42
                 } else {
43
-                    $this->assertFalse($scalarType->isValidValue($data), $typeName . ' validation for :' . serialize($data));
43
+                    $this->assertFalse($scalarType->isValidValue($data), $typeName.' validation for :'.serialize($data));
44 44
                 }
45 45
             }
46 46
         }
@@ -52,12 +52,12 @@  discard block
 block discarded – undo
52 52
 
53 53
     private function assertSerialization(AbstractScalarType $object, $input, $expected)
54 54
     {
55
-        $this->assertEquals($expected, $object->serialize($input), $object->getName() . ' serialize for: ' . serialize($input));
55
+        $this->assertEquals($expected, $object->serialize($input), $object->getName().' serialize for: '.serialize($input));
56 56
     }
57 57
 
58 58
     private function assertParse(AbstractScalarType $object, $input, $expected)
59 59
     {
60
-        $this->assertEquals($expected, $object->parseValue($input), $object->getName() . ' serialize for: ' . serialize($input));
60
+        $this->assertEquals($expected, $object->parseValue($input), $object->getName().' serialize for: '.serialize($input));
61 61
     }
62 62
 
63 63
 }
Please login to merge, or discard this patch.
Tests/Library/Type/InterfaceTypeTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@
 block discarded – undo
43 43
             'fields'      => [
44 44
                 'name' => new StringType()
45 45
             ],
46
-            'resolveType' => function ($object) {
46
+            'resolveType' => function($object) {
47 47
                 return $object;
48 48
             }
49 49
         ]);
Please login to merge, or discard this patch.
Tests/Library/Type/UnionTypeTest.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
                 new TestObjectType(),
33 33
                 $object
34 34
             ],
35
-            'resolveType' => function ($type) {
35
+            'resolveType' => function($type) {
36 36
                 return $type;
37 37
             }
38 38
         ]);
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
             'types'       => [
68 68
                 'test', new IntType()
69 69
             ],
70
-            'resolveType' => function ($type) {
70
+            'resolveType' => function($type) {
71 71
                 return $type;
72 72
             }
73 73
         ]);
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
             'types'       => [
85 85
                 new IntType()
86 86
             ],
87
-            'resolveType' => function ($type) {
87
+            'resolveType' => function($type) {
88 88
                 return $type;
89 89
             }
90 90
         ]);
Please login to merge, or discard this patch.
Tests/Library/Type/EnumTypeTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -102,7 +102,7 @@
 block discarded – undo
102 102
                 'value' => 'disable'
103 103
             ]
104 104
         ];
105
-        $enumType   = new EnumType([
105
+        $enumType = new EnumType([
106 106
             'name'   => 'BoolEnum',
107 107
             'values' => $valuesData
108 108
         ]);
Please login to merge, or discard this patch.
Tests/Library/Field/FieldAwareConfigTraitTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
24 24
                 'type' => new IntType()
25 25
             ]
26 26
         ];
27
-        $config     = new ObjectTypeConfig([
27
+        $config = new ObjectTypeConfig([
28 28
             'name'   => 'UserType',
29 29
             'fields' => $fieldsData
30 30
         ]);
Please login to merge, or discard this patch.
Tests/Library/Field/FieldTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@
 block discarded – undo
36 36
         $fieldWithResolve = new Field([
37 37
             'name'    => 'title',
38 38
             'type'    => new StringType(),
39
-            'resolve' => function ($value, array $args, ResolveInfo $info) {
39
+            'resolve' => function($value, array $args, ResolveInfo $info) {
40 40
                 return $info->getReturnType()->serialize($value);
41 41
             }
42 42
         ]);
Please login to merge, or discard this patch.