@@ -15,8 +15,8 @@ |
||
15 | 15 | public function getVisitor(ValidationContext $context) |
16 | 16 | { |
17 | 17 | return [ |
18 | - 'enter' => function (Node $node) use ($context) { |
|
19 | - if (! isset($node->directives)) { |
|
18 | + 'enter' => function(Node $node) use ($context) { |
|
19 | + if (!isset($node->directives)) { |
|
20 | 20 | return; |
21 | 21 | } |
22 | 22 |
@@ -19,13 +19,13 @@ discard block |
||
19 | 19 | public function getVisitor(ValidationContext $context) |
20 | 20 | { |
21 | 21 | return [ |
22 | - NodeKind::INLINE_FRAGMENT => function (InlineFragmentNode $node) use ($context) { |
|
23 | - if (! $node->typeCondition) { |
|
22 | + NodeKind::INLINE_FRAGMENT => function(InlineFragmentNode $node) use ($context) { |
|
23 | + if (!$node->typeCondition) { |
|
24 | 24 | return; |
25 | 25 | } |
26 | 26 | |
27 | 27 | $type = TypeInfo::typeFromAST($context->getSchema(), $node->typeCondition); |
28 | - if (! $type || Type::isCompositeType($type)) { |
|
28 | + if (!$type || Type::isCompositeType($type)) { |
|
29 | 29 | return; |
30 | 30 | } |
31 | 31 | |
@@ -34,10 +34,10 @@ discard block |
||
34 | 34 | [$node->typeCondition] |
35 | 35 | )); |
36 | 36 | }, |
37 | - NodeKind::FRAGMENT_DEFINITION => function (FragmentDefinitionNode $node) use ($context) { |
|
37 | + NodeKind::FRAGMENT_DEFINITION => function(FragmentDefinitionNode $node) use ($context) { |
|
38 | 38 | $type = TypeInfo::typeFromAST($context->getSchema(), $node->typeCondition); |
39 | 39 | |
40 | - if (! $type || Type::isCompositeType($type)) { |
|
40 | + if (!$type || Type::isCompositeType($type)) { |
|
41 | 41 | return; |
42 | 42 | } |
43 | 43 |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | $this->knownOperationNames = []; |
23 | 23 | |
24 | 24 | return [ |
25 | - NodeKind::OPERATION_DEFINITION => function (OperationDefinitionNode $node) use ($context) { |
|
25 | + NodeKind::OPERATION_DEFINITION => function(OperationDefinitionNode $node) use ($context) { |
|
26 | 26 | $operationName = $node->name; |
27 | 27 | |
28 | 28 | if ($operationName) { |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | |
39 | 39 | return Visitor::skipNode(); |
40 | 40 | }, |
41 | - NodeKind::FRAGMENT_DEFINITION => function () { |
|
41 | + NodeKind::FRAGMENT_DEFINITION => function() { |
|
42 | 42 | return Visitor::skipNode(); |
43 | 43 | }, |
44 | 44 | ]; |
@@ -24,10 +24,10 @@ discard block |
||
24 | 24 | { |
25 | 25 | return [ |
26 | 26 | NodeKind::OPERATION_DEFINITION => [ |
27 | - 'enter' => function () { |
|
27 | + 'enter' => function() { |
|
28 | 28 | $this->varDefMap = []; |
29 | 29 | }, |
30 | - 'leave' => function (OperationDefinitionNode $operation) use ($context) { |
|
30 | + 'leave' => function(OperationDefinitionNode $operation) use ($context) { |
|
31 | 31 | $usages = $context->getRecursiveVariableUsages($operation); |
32 | 32 | |
33 | 33 | foreach ($usages as $usage) { |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | $varName = $node->name->value; |
37 | 37 | $varDef = $this->varDefMap[$varName] ?? null; |
38 | 38 | |
39 | - if (! $varDef || ! $type) { |
|
39 | + if (!$varDef || !$type) { |
|
40 | 40 | continue; |
41 | 41 | } |
42 | 42 | |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | $schema = $context->getSchema(); |
49 | 49 | $varType = TypeInfo::typeFromAST($schema, $varDef->type); |
50 | 50 | |
51 | - if (! $varType || TypeComparators::isTypeSubTypeOf( |
|
51 | + if (!$varType || TypeComparators::isTypeSubTypeOf( |
|
52 | 52 | $schema, |
53 | 53 | $this->effectiveType($varType, $varDef), |
54 | 54 | $type |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | } |
64 | 64 | }, |
65 | 65 | ], |
66 | - NodeKind::VARIABLE_DEFINITION => function (VariableDefinitionNode $varDefNode) { |
|
66 | + NodeKind::VARIABLE_DEFINITION => function(VariableDefinitionNode $varDefNode) { |
|
67 | 67 | $this->varDefMap[$varDefNode->variable->name->value] = $varDefNode; |
68 | 68 | }, |
69 | 69 | ]; |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | |
72 | 72 | private function effectiveType($varType, $varDef) |
73 | 73 | { |
74 | - return (! $varDef->defaultValue || $varType instanceof NonNull) ? $varType : new NonNull($varType); |
|
74 | + return (!$varDef->defaultValue || $varType instanceof NonNull) ? $varType : new NonNull($varType); |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | /** |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | protected function invokeIfNeeded(ValidationContext $context, array $validators) |
62 | 62 | { |
63 | 63 | // is disabled? |
64 | - if (! $this->isEnabled()) { |
|
64 | + if (!$this->isEnabled()) { |
|
65 | 65 | return []; |
66 | 66 | } |
67 | 67 | |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | // Importantly this does not include inline fragments. |
79 | 79 | $definitions = $context->getDocument()->definitions; |
80 | 80 | foreach ($definitions as $node) { |
81 | - if (! ($node instanceof FragmentDefinitionNode)) { |
|
81 | + if (!($node instanceof FragmentDefinitionNode)) { |
|
82 | 82 | continue; |
83 | 83 | } |
84 | 84 | |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | } |
134 | 134 | } |
135 | 135 | $responseName = $this->getFieldName($selection); |
136 | - if (! isset($_astAndDefs[$responseName])) { |
|
136 | + if (!isset($_astAndDefs[$responseName])) { |
|
137 | 137 | $_astAndDefs[$responseName] = new \ArrayObject(); |
138 | 138 | } |
139 | 139 | // create field context |
@@ -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] |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | public function getVisitor(ValidationContext $context) |
26 | 26 | { |
27 | 27 | return [ |
28 | - NodeKind::VARIABLE_DEFINITION => function (VariableDefinitionNode $node) use ($context) { |
|
28 | + NodeKind::VARIABLE_DEFINITION => function(VariableDefinitionNode $node) use ($context) { |
|
29 | 29 | $name = $node->variable->name->value; |
30 | 30 | $defaultValue = $node->defaultValue; |
31 | 31 | $type = $context->getInputType(); |
@@ -44,10 +44,10 @@ discard block |
||
44 | 44 | |
45 | 45 | return Visitor::skipNode(); |
46 | 46 | }, |
47 | - NodeKind::SELECTION_SET => function (SelectionSetNode $node) use ($context) { |
|
47 | + NodeKind::SELECTION_SET => function(SelectionSetNode $node) use ($context) { |
|
48 | 48 | return Visitor::skipNode(); |
49 | 49 | }, |
50 | - NodeKind::FRAGMENT_DEFINITION => function (FragmentDefinitionNode $node) use ($context) { |
|
50 | + NodeKind::FRAGMENT_DEFINITION => function(FragmentDefinitionNode $node) use ($context) { |
|
51 | 51 | return Visitor::skipNode(); |
52 | 52 | }, |
53 | 53 | ]; |