@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | $parentType->name, |
52 | 52 | Utils::suggestionList( |
53 | 53 | $node->name->value, |
54 | - array_map(function ($arg) { return $arg->name; }, $fieldDef->args) |
|
54 | + array_map(function($arg) { return $arg->name; }, $fieldDef->args) |
|
55 | 55 | ) |
56 | 56 | ), |
57 | 57 | [$node] |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | $directive->name, |
67 | 67 | Utils::suggestionList( |
68 | 68 | $node->name->value, |
69 | - array_map(function ($arg) { return $arg->name; }, $directive->args) |
|
69 | + array_map(function($arg) { return $arg->name; }, $directive->args) |
|
70 | 70 | ) |
71 | 71 | ), |
72 | 72 | [$node] |
@@ -46,7 +46,7 @@ |
||
46 | 46 | $varName, |
47 | 47 | $operation->name ? $operation->name->value : null |
48 | 48 | ), |
49 | - [ $node, $operation ] |
|
49 | + [$node, $operation] |
|
50 | 50 | )); |
51 | 51 | } |
52 | 52 | } |
@@ -35,10 +35,10 @@ discard block |
||
35 | 35 | $this->spreadPathIndexByName = []; |
36 | 36 | |
37 | 37 | return [ |
38 | - NodeKind::OPERATION_DEFINITION => function () { |
|
38 | + NodeKind::OPERATION_DEFINITION => function() { |
|
39 | 39 | return Visitor::skipNode(); |
40 | 40 | }, |
41 | - NodeKind::FRAGMENT_DEFINITION => function (FragmentDefinitionNode $node) use ($context) { |
|
41 | + NodeKind::FRAGMENT_DEFINITION => function(FragmentDefinitionNode $node) use ($context) { |
|
42 | 42 | if (!isset($this->visitedFrags[$node->name->value])) { |
43 | 43 | $this->detectCycleRecursive($node, $context); |
44 | 44 | } |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | $context->reportError(new Error( |
88 | 88 | self::cycleErrorMessage( |
89 | 89 | $spreadName, |
90 | - Utils::map($cyclePath, function ($s) { |
|
90 | + Utils::map($cyclePath, function($s) { |
|
91 | 91 | return $s->name->value; |
92 | 92 | }) |
93 | 93 | ), |
@@ -30,7 +30,7 @@ |
||
30 | 30 | $variableName = $node->variable->name->value; |
31 | 31 | $context->reportError(new Error( |
32 | 32 | self::nonInputTypeOnVarMessage($variableName, Printer::doPrint($node->type)), |
33 | - [ $node->type ] |
|
33 | + [$node->type] |
|
34 | 34 | )); |
35 | 35 | } |
36 | 36 | } |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | public function getVisitor(ValidationContext $context) |
24 | 24 | { |
25 | 25 | return [ |
26 | - NodeKind::DIRECTIVE => function (DirectiveNode $node, $key, $parent, $path, $ancestors) use ($context) { |
|
26 | + NodeKind::DIRECTIVE => function(DirectiveNode $node, $key, $parent, $path, $ancestors) use ($context) { |
|
27 | 27 | $directiveDef = null; |
28 | 28 | foreach ($context->getSchema()->getDirectives() as $def) { |
29 | 29 | if ($def->name === $node->name->value) { |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | } else if (!in_array($candidateLocation, $directiveDef->locations)) { |
50 | 50 | $context->reportError(new Error( |
51 | 51 | self::misplacedDirectiveMessage($node->name->value, $candidateLocation), |
52 | - [ $node ] |
|
52 | + [$node] |
|
53 | 53 | )); |
54 | 54 | } |
55 | 55 | } |
@@ -36,14 +36,14 @@ |
||
36 | 36 | $type = $context->getInputType(); |
37 | 37 | if ($type instanceof NonNull && $defaultValue) { |
38 | 38 | $context->reportError( |
39 | - new Error( |
|
40 | - self::defaultForRequiredVarMessage( |
|
41 | - $name, |
|
42 | - $type, |
|
43 | - $type->getWrappedType() |
|
44 | - ), |
|
45 | - [$defaultValue] |
|
46 | - ) |
|
39 | + new Error( |
|
40 | + self::defaultForRequiredVarMessage( |
|
41 | + $name, |
|
42 | + $type, |
|
43 | + $type->getWrappedType() |
|
44 | + ), |
|
45 | + [$defaultValue] |
|
46 | + ) |
|
47 | 47 | ); |
48 | 48 | } |
49 | 49 |
@@ -28,7 +28,7 @@ |
||
28 | 28 | if (!empty($this->knownVariableNames[$variableName])) { |
29 | 29 | $context->reportError(new Error( |
30 | 30 | self::duplicateVariableMessage($variableName), |
31 | - [ $this->knownVariableNames[$variableName], $node->variable->name ] |
|
31 | + [$this->knownVariableNames[$variableName], $node->variable->name] |
|
32 | 32 | )); |
33 | 33 | } else { |
34 | 34 | $this->knownVariableNames[$variableName] = $node->variable->name; |
@@ -21,15 +21,15 @@ |
||
21 | 21 | $this->knownFragmentNames = []; |
22 | 22 | |
23 | 23 | return [ |
24 | - NodeKind::OPERATION_DEFINITION => function () { |
|
24 | + NodeKind::OPERATION_DEFINITION => function() { |
|
25 | 25 | return Visitor::skipNode(); |
26 | 26 | }, |
27 | - NodeKind::FRAGMENT_DEFINITION => function (FragmentDefinitionNode $node) use ($context) { |
|
27 | + NodeKind::FRAGMENT_DEFINITION => function(FragmentDefinitionNode $node) use ($context) { |
|
28 | 28 | $fragmentName = $node->name->value; |
29 | 29 | if (!empty($this->knownFragmentNames[$fragmentName])) { |
30 | 30 | $context->reportError(new Error( |
31 | 31 | self::duplicateFragmentNameMessage($fragmentName), |
32 | - [ $this->knownFragmentNames[$fragmentName], $node->name ] |
|
32 | + [$this->knownFragmentNames[$fragmentName], $node->name] |
|
33 | 33 | )); |
34 | 34 | } else { |
35 | 35 | $this->knownFragmentNames[$fragmentName] = $node->name; |
@@ -60,10 +60,10 @@ |
||
60 | 60 | $type = $context->getInputType(); |
61 | 61 | if ($type instanceof NonNull) { |
62 | 62 | $context->reportError( |
63 | - new Error( |
|
64 | - self::badValueMessage((string) $type, Printer::doPrint($node)), |
|
65 | - $node |
|
66 | - ) |
|
63 | + new Error( |
|
64 | + self::badValueMessage((string) $type, Printer::doPrint($node)), |
|
65 | + $node |
|
66 | + ) |
|
67 | 67 | ); |
68 | 68 | } |
69 | 69 | }, |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | { |
36 | 36 | static function badValueMessage($typeName, $valueName, $message = null) |
37 | 37 | { |
38 | - return "Expected type {$typeName}, found {$valueName}" . |
|
38 | + return "Expected type {$typeName}, found {$valueName}" . |
|
39 | 39 | ($message ? "; ${message}" : '.'); |
40 | 40 | } |
41 | 41 | |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | $inputFields = $type->getFields(); |
89 | 89 | $nodeFields = iterator_to_array($node->fields); |
90 | 90 | $fieldNodeMap = array_combine( |
91 | - array_map(function ($field) { return $field->name->value; }, $nodeFields), |
|
91 | + array_map(function($field) { return $field->name->value; }, $nodeFields), |
|
92 | 92 | array_values($nodeFields) |
93 | 93 | ); |
94 | 94 | foreach ($inputFields as $fieldName => $fieldDef) { |
@@ -140,10 +140,10 @@ discard block |
||
140 | 140 | ); |
141 | 141 | } |
142 | 142 | }, |
143 | - NodeKind::INT => function (IntValueNode $node) use ($context) { $this->isValidScalar($context, $node); }, |
|
144 | - NodeKind::FLOAT => function (FloatValueNode $node) use ($context) { $this->isValidScalar($context, $node); }, |
|
145 | - NodeKind::STRING => function (StringValueNode $node) use ($context) { $this->isValidScalar($context, $node); }, |
|
146 | - NodeKind::BOOLEAN => function (BooleanValueNode $node) use ($context) { $this->isValidScalar($context, $node); }, |
|
143 | + NodeKind::INT => function(IntValueNode $node) use ($context) { $this->isValidScalar($context, $node); }, |
|
144 | + NodeKind::FLOAT => function(FloatValueNode $node) use ($context) { $this->isValidScalar($context, $node); }, |
|
145 | + NodeKind::STRING => function(StringValueNode $node) use ($context) { $this->isValidScalar($context, $node); }, |
|
146 | + NodeKind::BOOLEAN => function(BooleanValueNode $node) use ($context) { $this->isValidScalar($context, $node); }, |
|
147 | 147 | ]; |
148 | 148 | } |
149 | 149 | |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | if ($type instanceof EnumType) { |
217 | 217 | $suggestions = Utils::suggestionList( |
218 | 218 | Printer::doPrint($node), |
219 | - array_map(function (EnumValueDefinition $value) { |
|
219 | + array_map(function(EnumValueDefinition $value) { |
|
220 | 220 | return $value->name; |
221 | 221 | }, $type->getValues()) |
222 | 222 | ); |