@@ -13,7 +13,7 @@ |
||
13 | 13 | $processor->processPayload($this->getIntrospectionQuery(), []); |
14 | 14 | $resp = $processor->getResponseData(); |
15 | 15 | |
16 | - $enumTypes = array_filter($resp['data']['__schema']['types'], function($type){ |
|
16 | + $enumTypes = array_filter($resp['data']['__schema']['types'], function($type) { |
|
17 | 17 | return ($type['kind'] === 'ENUM'); |
18 | 18 | }); |
19 | 19 |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | $unionType = new UnionType([ |
33 | 33 | 'name' => 'Union', |
34 | 34 | 'types' => [$type1, $type2], |
35 | - 'resolveType' => function ($value) use ($type1, $type2) { |
|
35 | + 'resolveType' => function($value) use ($type1, $type2) { |
|
36 | 36 | if (isset($value['name'])) { |
37 | 37 | return $type1; |
38 | 38 | } |
@@ -41,13 +41,13 @@ discard block |
||
41 | 41 | }, |
42 | 42 | ]); |
43 | 43 | |
44 | - $schema = new Schema([ |
|
44 | + $schema = new Schema([ |
|
45 | 45 | 'query' => new ObjectType([ |
46 | 46 | 'name' => 'RootQuery', |
47 | 47 | 'fields' => [ |
48 | 48 | 'list' => [ |
49 | 49 | 'type' => new ListType($unionType), |
50 | - 'resolve' => function () { |
|
50 | + 'resolve' => function() { |
|
51 | 51 | return [ |
52 | 52 | [ |
53 | 53 | 'id' => 1, |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | { |
16 | 16 | public function testInternalVariableArgument() |
17 | 17 | { |
18 | - $schema = new Schema([ |
|
18 | + $schema = new Schema([ |
|
19 | 19 | 'query' => new ObjectType([ |
20 | 20 | 'name' => 'RootQuery', |
21 | 21 | 'fields' => [ |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | ])), |
37 | 37 | ], |
38 | 38 | ]), |
39 | - 'resolve' => function () { |
|
39 | + 'resolve' => function() { |
|
40 | 40 | return [ |
41 | 41 | 'id' => 1, |
42 | 42 | 'name' => 'John', |
@@ -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' => 'isDeprecated', 'args' => []], ['name' => 'deprecationReason', 'args' => []], ['name' => 'type', 'args' => []], ['name' => 'defaultValue', 'args' => []],]], |
|
205 | + ['name' => '__InputValue', 'fields' => [['name' => 'name', 'args' => []], ['name' => 'description', 'args' => []], ['name' => 'isDeprecated', 'args' => []], ['name' => 'deprecationReason', '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' => 'locations', 'args' => []]]], |
210 | 210 | ['name' => '__DirectiveLocation', 'fields' => null], |
@@ -292,7 +292,7 @@ discard block |
||
292 | 292 | 'id' => ['type' => new IntType()], |
293 | 293 | 'name' => ['type' => new IntType()], |
294 | 294 | ], |
295 | - 'resolveType' => function ($type) { |
|
295 | + 'resolveType' => function($type) { |
|
296 | 296 | |
297 | 297 | } |
298 | 298 | ]); |
@@ -320,7 +320,7 @@ discard block |
||
320 | 320 | $unionType = new UnionType([ |
321 | 321 | 'name' => 'UnionType', |
322 | 322 | 'types' => [$object1, $object2], |
323 | - 'resolveType' => function () { |
|
323 | + 'resolveType' => function() { |
|
324 | 324 | |
325 | 325 | } |
326 | 326 | ]); |
@@ -331,7 +331,7 @@ discard block |
||
331 | 331 | 'args' => [ |
332 | 332 | 'id' => ['type' => TypeMap::TYPE_INT] |
333 | 333 | ], |
334 | - 'resolve' => function () { |
|
334 | + 'resolve' => function() { |
|
335 | 335 | return [ |
336 | 336 | 'id' => 1, |
337 | 337 | 'name' => 'Alex' |
@@ -357,7 +357,7 @@ discard block |
||
357 | 357 | ] |
358 | 358 | ]) |
359 | 359 | ], |
360 | - 'resolve' => function () { |
|
360 | + 'resolve' => function() { |
|
361 | 361 | return null; |
362 | 362 | } |
363 | 363 | ])); |
@@ -253,9 +253,9 @@ discard block |
||
253 | 253 | $value = substr($this->source, $start, $this->pos - $start); |
254 | 254 | |
255 | 255 | if (strpos($value, '.') === false) { |
256 | - $value = (int) $value; |
|
256 | + $value = (int)$value; |
|
257 | 257 | } else { |
258 | - $value = (float) $value; |
|
258 | + $value = (float)$value; |
|
259 | 259 | } |
260 | 260 | |
261 | 261 | return new Token(Token::TYPE_NUMBER, $this->getLine(), $this->getColumn(), $value); |
@@ -311,10 +311,10 @@ discard block |
||
311 | 311 | return $token; |
312 | 312 | } |
313 | 313 | |
314 | - if($ch === '\\' && ($this->pos < ($len - 1))) { |
|
314 | + if ($ch === '\\' && ($this->pos < ($len - 1))) { |
|
315 | 315 | $this->pos++; |
316 | 316 | $ch = $this->source[$this->pos]; |
317 | - switch($ch) { |
|
317 | + switch ($ch) { |
|
318 | 318 | case '"': |
319 | 319 | case '\\': |
320 | 320 | case '/': |
@@ -333,7 +333,7 @@ discard block |
||
333 | 333 | break; |
334 | 334 | case 'u': |
335 | 335 | $codepoint = substr($this->source, $this->pos + 1, 4); |
336 | - if( !preg_match('/[0-9A-Fa-f]{4}/', $codepoint)) { |
|
336 | + if (!preg_match('/[0-9A-Fa-f]{4}/', $codepoint)) { |
|
337 | 337 | throw $this->createException(sprintf('Invalid string unicode escape sequece "%s"', $codepoint)); |
338 | 338 | } |
339 | 339 | $ch = html_entity_decode("&#x{$codepoint};", ENT_QUOTES, 'UTF-8'); |
@@ -104,7 +104,7 @@ |
||
104 | 104 | |
105 | 105 | private function tokenizeStringContents($graphQLString) { |
106 | 106 | $parser = new TokenizerTestingParser(); |
107 | - $parser->initTokenizerForTesting('"' . $graphQLString . '"'); |
|
107 | + $parser->initTokenizerForTesting('"'.$graphQLString.'"'); |
|
108 | 108 | |
109 | 109 | return $parser->getTokenForTesting(); |
110 | 110 | } |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | } |
66 | 66 | |
67 | 67 | $typeConfig = $this->getConfig(); |
68 | - $requiredFields = array_filter($typeConfig->getFields(), function (InputFieldInterface $field) { |
|
68 | + $requiredFields = array_filter($typeConfig->getFields(), function(InputFieldInterface $field) { |
|
69 | 69 | return $field->getType()->getKind() == TypeMap::KIND_NON_NULL; |
70 | 70 | }); |
71 | 71 | |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | public function parseValue($value) |
107 | 107 | { |
108 | 108 | if (is_null($value)) return null; |
109 | - if($value instanceof InputObject) { |
|
109 | + if ($value instanceof InputObject) { |
|
110 | 110 | $value = $value->getValue(); |
111 | 111 | } |
112 | 112 |
@@ -393,7 +393,7 @@ discard block |
||
393 | 393 | */ |
394 | 394 | protected function deferredResolve($resolvedValue, FieldInterface $field, callable $callback) { |
395 | 395 | if ($resolvedValue instanceof DeferredResolverInterface) { |
396 | - $deferredResult = new DeferredResult($resolvedValue, function ($resolvedValue) use ($field, $callback) { |
|
396 | + $deferredResult = new DeferredResult($resolvedValue, function($resolvedValue) use ($field, $callback) { |
|
397 | 397 | // Allow nested deferred resolvers. |
398 | 398 | return $this->deferredResolve($resolvedValue, $field, $callback); |
399 | 399 | }); |
@@ -431,7 +431,7 @@ discard block |
||
431 | 431 | /** @var AstQuery $ast */ |
432 | 432 | $resolvedValue = $this->doResolve($field, $ast, $parentValue); |
433 | 433 | |
434 | - return $this->deferredResolve($resolvedValue, $field, function ($resolvedValue) use ($field, $ast, $parentValue) { |
|
434 | + return $this->deferredResolve($resolvedValue, $field, function($resolvedValue) use ($field, $ast, $parentValue) { |
|
435 | 435 | $this->resolveValidator->assertValidResolvedValueForField($field, $resolvedValue); |
436 | 436 | |
437 | 437 | if (null === $resolvedValue) { |
@@ -456,7 +456,7 @@ discard block |
||
456 | 456 | $result = []; |
457 | 457 | foreach ($resolvedValue as $resolvedValueItem) { |
458 | 458 | try { |
459 | - $fakeField->getConfig()->set('resolve', function () use ($resolvedValueItem) { |
|
459 | + $fakeField->getConfig()->set('resolve', function() use ($resolvedValueItem) { |
|
460 | 460 | return $resolvedValueItem; |
461 | 461 | }); |
462 | 462 | |
@@ -502,7 +502,7 @@ discard block |
||
502 | 502 | $resolvedValue = $this->doResolve($field, $ast, $parentValue); |
503 | 503 | } |
504 | 504 | |
505 | - return $this->deferredResolve($resolvedValue, $field, function ($resolvedValue) use ($field, $ast, $parentValue) { |
|
505 | + return $this->deferredResolve($resolvedValue, $field, function($resolvedValue) use ($field, $ast, $parentValue) { |
|
506 | 506 | $this->resolveValidator->assertValidResolvedValueForField($field, $resolvedValue); |
507 | 507 | |
508 | 508 | if (null === $resolvedValue) { |
@@ -523,7 +523,7 @@ discard block |
||
523 | 523 | { |
524 | 524 | /** @var AstQuery $ast */ |
525 | 525 | $resolvedValue = $this->doResolve($field, $ast, $parentValue); |
526 | - return $this->deferredResolve($resolvedValue, $field, function ($resolvedValue) use ($field, $ast, $parentValue) { |
|
526 | + return $this->deferredResolve($resolvedValue, $field, function($resolvedValue) use ($field, $ast, $parentValue) { |
|
527 | 527 | $this->resolveValidator->assertValidResolvedValueForField($field, $resolvedValue); |
528 | 528 | |
529 | 529 | if (null === $resolvedValue) { |
@@ -531,7 +531,7 @@ discard block |
||
531 | 531 | } |
532 | 532 | |
533 | 533 | /** @var AbstractUnionType $type */ |
534 | - $type = $field->getType()->getNullableType(); |
|
534 | + $type = $field->getType()->getNullableType(); |
|
535 | 535 | $resolveInfo = new ResolveInfo( |
536 | 536 | $field, |
537 | 537 | $ast instanceof AstQuery ? $ast->getFields() : [], |