@@ -23,12 +23,12 @@ discard block |
||
23 | 23 | public function getVisitor(ValidationContext $context) |
24 | 24 | { |
25 | 25 | return [ |
26 | - NodeKind::INLINE_FRAGMENT => function (InlineFragmentNode $node) use ($context) { |
|
26 | + NodeKind::INLINE_FRAGMENT => function(InlineFragmentNode $node) use ($context) { |
|
27 | 27 | $fragType = $context->getType(); |
28 | 28 | $parentType = $context->getParentType(); |
29 | 29 | |
30 | - if (! ($fragType instanceof CompositeType) || |
|
31 | - ! ($parentType instanceof CompositeType) || |
|
30 | + if (!($fragType instanceof CompositeType) || |
|
31 | + !($parentType instanceof CompositeType) || |
|
32 | 32 | $this->doTypesOverlap($context->getSchema(), $fragType, $parentType)) { |
33 | 33 | return; |
34 | 34 | } |
@@ -38,13 +38,13 @@ discard block |
||
38 | 38 | [$node] |
39 | 39 | )); |
40 | 40 | }, |
41 | - NodeKind::FRAGMENT_SPREAD => function (FragmentSpreadNode $node) use ($context) { |
|
41 | + NodeKind::FRAGMENT_SPREAD => function(FragmentSpreadNode $node) use ($context) { |
|
42 | 42 | $fragName = $node->name->value; |
43 | 43 | $fragType = $this->getFragmentType($context, $fragName); |
44 | 44 | $parentType = $context->getParentType(); |
45 | 45 | |
46 | - if (! $fragType || |
|
47 | - ! $parentType || |
|
46 | + if (!$fragType || |
|
47 | + !$parentType || |
|
48 | 48 | $this->doTypesOverlap($context->getSchema(), $fragType, $parentType) |
49 | 49 | ) { |
50 | 50 | return; |
@@ -21,10 +21,10 @@ |
||
21 | 21 | $this->knownVariableNames = []; |
22 | 22 | |
23 | 23 | return [ |
24 | - NodeKind::OPERATION_DEFINITION => function () { |
|
24 | + NodeKind::OPERATION_DEFINITION => function() { |
|
25 | 25 | $this->knownVariableNames = []; |
26 | 26 | }, |
27 | - NodeKind::VARIABLE_DEFINITION => function (VariableDefinitionNode $node) use ($context) { |
|
27 | + NodeKind::VARIABLE_DEFINITION => function(VariableDefinitionNode $node) use ($context) { |
|
28 | 28 | $variableName = $node->variable->name->value; |
29 | 29 | if (empty($this->knownVariableNames[$variableName])) { |
30 | 30 | $this->knownVariableNames[$variableName] = $node->variable->name; |
@@ -16,9 +16,9 @@ discard block |
||
16 | 16 | public function getVisitor(ValidationContext $context) |
17 | 17 | { |
18 | 18 | return [ |
19 | - NodeKind::FIELD => function (FieldNode $node) use ($context) { |
|
19 | + NodeKind::FIELD => function(FieldNode $node) use ($context) { |
|
20 | 20 | $type = $context->getType(); |
21 | - if (! $type) { |
|
21 | + if (!$type) { |
|
22 | 22 | return; |
23 | 23 | } |
24 | 24 | |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | [$node->selectionSet] |
30 | 30 | )); |
31 | 31 | } |
32 | - } elseif (! $node->selectionSet) { |
|
32 | + } elseif (!$node->selectionSet) { |
|
33 | 33 | $context->reportError(new Error( |
34 | 34 | self::requiredSubselectionMessage($node->name->value, $type), |
35 | 35 | [$node] |
@@ -27,18 +27,18 @@ |
||
27 | 27 | |
28 | 28 | return [ |
29 | 29 | NodeKind::OBJECT => [ |
30 | - 'enter' => function () { |
|
30 | + 'enter' => function() { |
|
31 | 31 | $this->knownNameStack[] = $this->knownNames; |
32 | 32 | $this->knownNames = []; |
33 | 33 | }, |
34 | - 'leave' => function () { |
|
34 | + 'leave' => function() { |
|
35 | 35 | $this->knownNames = array_pop($this->knownNameStack); |
36 | 36 | }, |
37 | 37 | ], |
38 | - NodeKind::OBJECT_FIELD => function (ObjectFieldNode $node) use ($context) { |
|
38 | + NodeKind::OBJECT_FIELD => function(ObjectFieldNode $node) use ($context) { |
|
39 | 39 | $fieldName = $node->name->value; |
40 | 40 | |
41 | - if (! empty($this->knownNames[$fieldName])) { |
|
41 | + if (!empty($this->knownNames[$fieldName])) { |
|
42 | 42 | $context->reportError(new Error( |
43 | 43 | self::duplicateInputFieldMessage($fieldName), |
44 | 44 | [$this->knownNames[$fieldName], $node->name] |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | return $this->invokeIfNeeded( |
57 | 57 | $context, |
58 | 58 | [ |
59 | - NodeKind::SELECTION_SET => function (SelectionSetNode $selectionSet) use ($context) { |
|
59 | + NodeKind::SELECTION_SET => function(SelectionSetNode $selectionSet) use ($context) { |
|
60 | 60 | $this->fieldNodeAndDefs = $this->collectFieldASTsAndDefs( |
61 | 61 | $context, |
62 | 62 | $context->getParentType(), |
@@ -65,16 +65,16 @@ discard block |
||
65 | 65 | $this->fieldNodeAndDefs |
66 | 66 | ); |
67 | 67 | }, |
68 | - NodeKind::VARIABLE_DEFINITION => function ($def) { |
|
68 | + NodeKind::VARIABLE_DEFINITION => function($def) { |
|
69 | 69 | $this->variableDefs[] = $def; |
70 | 70 | |
71 | 71 | return Visitor::skipNode(); |
72 | 72 | }, |
73 | 73 | NodeKind::OPERATION_DEFINITION => [ |
74 | - 'leave' => function (OperationDefinitionNode $operationDefinition) use ($context, &$complexity) { |
|
74 | + 'leave' => function(OperationDefinitionNode $operationDefinition) use ($context, &$complexity) { |
|
75 | 75 | $errors = $context->getErrors(); |
76 | 76 | |
77 | - if (! empty($errors)) { |
|
77 | + if (!empty($errors)) { |
|
78 | 78 | return; |
79 | 79 | } |
80 | 80 | |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | throw new Error(implode( |
197 | 197 | "\n\n", |
198 | 198 | array_map( |
199 | - function ($error) { |
|
199 | + function($error) { |
|
200 | 200 | return $error->getMessage(); |
201 | 201 | }, |
202 | 202 | $variableValuesResult['errors'] |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | $directive = Directive::includeDirective(); |
210 | 210 | $directiveArgs = Values::getArgumentValues($directive, $directiveNode, $variableValues); |
211 | 211 | |
212 | - return ! $directiveArgs['if']; |
|
212 | + return !$directiveArgs['if']; |
|
213 | 213 | } |
214 | 214 | |
215 | 215 | $directive = Directive::skipDirective(); |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | throw new Error(implode( |
252 | 252 | "\n\n", |
253 | 253 | array_map( |
254 | - function ($error) { |
|
254 | + function($error) { |
|
255 | 255 | return $error->getMessage(); |
256 | 256 | }, |
257 | 257 | $variableValuesResult['errors'] |
@@ -22,10 +22,10 @@ |
||
22 | 22 | $this->knownFragmentNames = []; |
23 | 23 | |
24 | 24 | return [ |
25 | - NodeKind::OPERATION_DEFINITION => function () { |
|
25 | + NodeKind::OPERATION_DEFINITION => function() { |
|
26 | 26 | return Visitor::skipNode(); |
27 | 27 | }, |
28 | - NodeKind::FRAGMENT_DEFINITION => function (FragmentDefinitionNode $node) use ($context) { |
|
28 | + NodeKind::FRAGMENT_DEFINITION => function(FragmentDefinitionNode $node) use ($context) { |
|
29 | 29 | $fragmentName = $node->name->value; |
30 | 30 | if (empty($this->knownFragmentNames[$fragmentName])) { |
31 | 31 | $this->knownFragmentNames[$fragmentName] = $node->name; |
@@ -15,7 +15,7 @@ |
||
15 | 15 | public function getVisitor(ValidationContext $context) |
16 | 16 | { |
17 | 17 | return [ |
18 | - NodeKind::FRAGMENT_SPREAD => function (FragmentSpreadNode $node) use ($context) { |
|
18 | + NodeKind::FRAGMENT_SPREAD => function(FragmentSpreadNode $node) use ($context) { |
|
19 | 19 | $fragmentName = $node->name->value; |
20 | 20 | $fragment = $context->getFragment($fragmentName); |
21 | 21 | if ($fragment) { |
@@ -31,7 +31,7 @@ |
||
31 | 31 | return $this->invokeIfNeeded( |
32 | 32 | $context, |
33 | 33 | [ |
34 | - NodeKind::FIELD => function (FieldNode $node) use ($context) { |
|
34 | + NodeKind::FIELD => function(FieldNode $node) use ($context) { |
|
35 | 35 | if ($node->name->value !== '__type' && $node->name->value !== '__schema') { |
36 | 36 | return; |
37 | 37 | } |
@@ -22,15 +22,15 @@ |
||
22 | 22 | $this->knownArgNames = []; |
23 | 23 | |
24 | 24 | return [ |
25 | - NodeKind::FIELD => function () { |
|
25 | + NodeKind::FIELD => function() { |
|
26 | 26 | $this->knownArgNames = []; |
27 | 27 | }, |
28 | - NodeKind::DIRECTIVE => function () { |
|
28 | + NodeKind::DIRECTIVE => function() { |
|
29 | 29 | $this->knownArgNames = []; |
30 | 30 | }, |
31 | - NodeKind::ARGUMENT => function (ArgumentNode $node) use ($context) { |
|
31 | + NodeKind::ARGUMENT => function(ArgumentNode $node) use ($context) { |
|
32 | 32 | $argName = $node->name->value; |
33 | - if (! empty($this->knownArgNames[$argName])) { |
|
33 | + if (!empty($this->knownArgNames[$argName])) { |
|
34 | 34 | $context->reportError(new Error( |
35 | 35 | self::duplicateArgMessage($argName), |
36 | 36 | [$this->knownArgNames[$argName], $node->name] |