@@ -53,7 +53,7 @@ |
||
53 | 53 | public function assertValidConfig(AbstractConfig $config) |
54 | 54 | { |
55 | 55 | if (!$this->isValidConfig($config)) { |
56 | - throw new ConfigurationException('Config is not valid for ' . ($config->getContextObject() ? get_class($config->getContextObject()) : null) . "\n" . implode("\n", $this->getErrorsArray(false))); |
|
56 | + throw new ConfigurationException('Config is not valid for '.($config->getContextObject() ? get_class($config->getContextObject()) : null)."\n".implode("\n", $this->getErrorsArray(false))); |
|
57 | 57 | } |
58 | 58 | } |
59 | 59 |
@@ -33,7 +33,7 @@ |
||
33 | 33 | |
34 | 34 | public function assertValidArguments(FieldInterface $field, AstFieldInterface $query, Request $request) |
35 | 35 | { |
36 | - $requiredArguments = array_filter($field->getArguments(), function (InputField $argument) { |
|
36 | + $requiredArguments = array_filter($field->getArguments(), function(InputField $argument) { |
|
37 | 37 | return $argument->getType()->getKind() === TypeMap::KIND_NON_NULL; |
38 | 38 | }); |
39 | 39 |
@@ -22,7 +22,7 @@ |
||
22 | 22 | |
23 | 23 | self::assertTrue(isset($res['data']['items'])); |
24 | 24 | |
25 | - foreach($res['data']['items'] as $item) { |
|
25 | + foreach ($res['data']['items'] as $item) { |
|
26 | 26 | self::assertTrue(isset($item['custom']['value'])); |
27 | 27 | self::assertEquals(self::BUG_NOT_EXISTS_VALUE, $item['custom']['value']); |
28 | 28 | } |
@@ -52,7 +52,7 @@ |
||
52 | 52 | 'args' => [ |
53 | 53 | 'example' => new StringType() |
54 | 54 | ], |
55 | - 'resolve' => function () { |
|
55 | + 'resolve' => function() { |
|
56 | 56 | return [ |
57 | 57 | ['id' => 1], |
58 | 58 | ['id' => 2], |
@@ -40,7 +40,7 @@ |
||
40 | 40 | ] |
41 | 41 | ] |
42 | 42 | ]), |
43 | - 'resolve' => function ($source, array $args, ResolveInfo $info) { |
|
43 | + 'resolve' => function($source, array $args, ResolveInfo $info) { |
|
44 | 44 | $internalArgs = [ |
45 | 45 | 'comment_id' => 200 |
46 | 46 | ]; |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | ['id' => 2, 'name' => 'Alex'], |
32 | 32 | ['id' => 3, 'name' => 'Mike'], |
33 | 33 | ]; |
34 | - $posts = []; |
|
34 | + $posts = []; |
|
35 | 35 | for ($i = 0; $i < 10; $i++) { |
36 | 36 | $posts[] = [ |
37 | 37 | 'id' => $i + 1, |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | 'fields' => [ |
68 | 68 | 'posts' => [ |
69 | 69 | 'type' => new ListType($postType), |
70 | - 'resolve' => function ($source, $args, $info) { |
|
70 | + 'resolve' => function($source, $args, $info) { |
|
71 | 71 | return $this->getDataForPosts(); |
72 | 72 | } |
73 | 73 | ] |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | if (!is_array($data)) return null; |
19 | 19 | |
20 | 20 | $index = array_search($object, $data); |
21 | - return $index === false ? null : (string) self::keyToCursor($index); |
|
21 | + return $index === false ? null : (string)self::keyToCursor($index); |
|
22 | 22 | } |
23 | 23 | |
24 | 24 | /** |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | |
35 | 35 | public static function keyToCursor($key) |
36 | 36 | { |
37 | - return base64_encode(self::PREFIX . $key); |
|
37 | + return base64_encode(self::PREFIX.$key); |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | /** |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | $offset = array_search($key, array_keys($array)); |
87 | 87 | } |
88 | 88 | |
89 | - return is_null($offset) ? $default : (int) $offset; |
|
89 | + return is_null($offset) ? $default : (int)$offset; |
|
90 | 90 | } |
91 | 91 | |
92 | 92 | public static function connectionFromArray(array $data, array $args = []) |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | |
37 | 37 | $this->assertEquals(1, count($schema->getMutationType()->getFields())); |
38 | 38 | |
39 | - $schema->addMutationField('changeUser', ['type' => new TestObjectType(), 'resolve' => function () { |
|
39 | + $schema->addMutationField('changeUser', ['type' => new TestObjectType(), 'resolve' => function() { |
|
40 | 40 | }]); |
41 | 41 | $this->assertEquals(2, count($schema->getMutationType()->getFields())); |
42 | 42 | |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | 'fields' => [ |
69 | 69 | 'name' => new StringType(), |
70 | 70 | ], |
71 | - 'resolveType' => function () use ($authorType) { |
|
71 | + 'resolveType' => function() use ($authorType) { |
|
72 | 72 | return $authorType; |
73 | 73 | } |
74 | 74 | ]); |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | 'fields' => [ |
88 | 88 | 'user' => [ |
89 | 89 | 'type' => $userInterface, |
90 | - 'resolve' => function () { |
|
90 | + 'resolve' => function() { |
|
91 | 91 | return [ |
92 | 92 | 'name' => 'Alex' |
93 | 93 | ]; |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | 'description' => 'latest description', |
137 | 137 | 'deprecationReason' => 'for test', |
138 | 138 | 'isDeprecated' => true, |
139 | - 'resolve' => function () { |
|
139 | + 'resolve' => function() { |
|
140 | 140 | return [ |
141 | 141 | 'id' => 1, |
142 | 142 | 'name' => 'Alex' |
@@ -202,9 +202,9 @@ discard block |
||
202 | 202 | ['name' => 'String', 'fields' => null], |
203 | 203 | ['name' => '__Schema', 'fields' => [['name' => 'queryType', 'args' => []], ['name' => 'mutationType', 'args' => []], ['name' => 'subscriptionType', 'args' => []], ['name' => 'types', 'args' => []], ['name' => 'directives', 'args' => []]]], |
204 | 204 | ['name' => '__Type', 'fields' => [['name' => 'name', 'args' => []], ['name' => 'kind', 'args' => []], ['name' => 'description', 'args' => []], ['name' => 'ofType', 'args' => []], ['name' => 'inputFields', 'args' => []], ['name' => 'enumValues', 'args' => [['defaultValue' => 'false']]], ['name' => 'fields', 'args' => [['defaultValue' => 'false']]], ['name' => 'interfaces', 'args' => []], ['name' => 'possibleTypes', 'args' => []]]], |
205 | - ['name' => '__InputValue', 'fields' => [['name' => 'name', 'args' => []], ['name' => 'description', 'args' => []], ['name' => 'type', 'args' => []], ['name' => 'defaultValue', 'args' => []],]], |
|
205 | + ['name' => '__InputValue', 'fields' => [['name' => 'name', 'args' => []], ['name' => 'description', 'args' => []], ['name' => 'type', 'args' => []], ['name' => 'defaultValue', 'args' => []], ]], |
|
206 | 206 | ['name' => 'Boolean', 'fields' => null], |
207 | - ['name' => '__EnumValue', 'fields' => [['name' => 'name', 'args' => []], ['name' => 'description', 'args' => []], ['name' => 'deprecationReason', 'args' => []], ['name' => 'isDeprecated', 'args' => []],]], |
|
207 | + ['name' => '__EnumValue', 'fields' => [['name' => 'name', 'args' => []], ['name' => 'description', 'args' => []], ['name' => 'deprecationReason', 'args' => []], ['name' => 'isDeprecated', 'args' => []], ]], |
|
208 | 208 | ['name' => '__Field', 'fields' => [['name' => 'name', 'args' => []], ['name' => 'description', 'args' => []], ['name' => 'isDeprecated', 'args' => []], ['name' => 'deprecationReason', 'args' => []], ['name' => 'type', 'args' => []], ['name' => 'args', 'args' => []]]], |
209 | 209 | ['name' => '__Directive', 'fields' => [['name' => 'name', 'args' => []], ['name' => 'description', 'args' => []], ['name' => 'args', 'args' => []], ['name' => 'onOperation', 'args' => []], ['name' => 'onFragment', 'args' => []], ['name' => 'onField', 'args' => []]]], |
210 | 210 | ] |
@@ -291,7 +291,7 @@ discard block |
||
291 | 291 | 'id' => ['type' => new IntType()], |
292 | 292 | 'name' => ['type' => new IntType()], |
293 | 293 | ], |
294 | - 'resolveType' => function ($type) { |
|
294 | + 'resolveType' => function($type) { |
|
295 | 295 | |
296 | 296 | } |
297 | 297 | ]); |
@@ -319,7 +319,7 @@ discard block |
||
319 | 319 | $unionType = new UnionType([ |
320 | 320 | 'name' => 'UnionType', |
321 | 321 | 'types' => [$object1, $object2], |
322 | - 'resolveType' => function () { |
|
322 | + 'resolveType' => function() { |
|
323 | 323 | |
324 | 324 | } |
325 | 325 | ]); |
@@ -330,7 +330,7 @@ discard block |
||
330 | 330 | 'args' => [ |
331 | 331 | 'id' => ['type' => TypeMap::TYPE_INT] |
332 | 332 | ], |
333 | - 'resolve' => function () { |
|
333 | + 'resolve' => function() { |
|
334 | 334 | return [ |
335 | 335 | 'id' => 1, |
336 | 336 | 'name' => 'Alex' |
@@ -356,7 +356,7 @@ discard block |
||
356 | 356 | ] |
357 | 357 | ]) |
358 | 358 | ], |
359 | - 'resolve' => function () { |
|
359 | + 'resolve' => function() { |
|
360 | 360 | return null; |
361 | 361 | } |
362 | 362 | ])); |