@@ -41,7 +41,7 @@ |
||
| 41 | 41 | $schemaDefinitionsCount = 0; |
| 42 | 42 | |
| 43 | 43 | return [ |
| 44 | - NodeKind::SCHEMA_DEFINITION => static function (SchemaDefinitionNode $node) use ($alreadyDefined, $context, &$schemaDefinitionsCount) { |
|
| 44 | + NodeKind::SCHEMA_DEFINITION => static function(SchemaDefinitionNode $node) use ($alreadyDefined, $context, &$schemaDefinitionsCount) { |
|
| 45 | 45 | if ($alreadyDefined !== false) { |
| 46 | 46 | $context->reportError(new Error(self::canNotDefineSchemaWithinExtensionMessage(), $node)); |
| 47 | 47 | |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | { |
| 24 | 24 | public function getVisitor(ValidationContext $context) |
| 25 | 25 | { |
| 26 | - $skip = static function () { |
|
| 26 | + $skip = static function() { |
|
| 27 | 27 | return Visitor::skipNode(); |
| 28 | 28 | }; |
| 29 | 29 | |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | NodeKind::INTERFACE_TYPE_DEFINITION => $skip, |
| 36 | 36 | NodeKind::UNION_TYPE_DEFINITION => $skip, |
| 37 | 37 | NodeKind::INPUT_OBJECT_TYPE_DEFINITION => $skip, |
| 38 | - NodeKind::NAMED_TYPE => static function (NamedTypeNode $node) use ($context) { |
|
| 38 | + NodeKind::NAMED_TYPE => static function(NamedTypeNode $node) use ($context) { |
|
| 39 | 39 | $schema = $context->getSchema(); |
| 40 | 40 | $typeName = $node->name->value; |
| 41 | 41 | $type = $schema->getType($typeName); |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | public static function unknownTypeMessage($type, array $suggestedTypes) |
| 62 | 62 | { |
| 63 | 63 | $message = sprintf('Unknown type "%s".', $type); |
| 64 | - if (! empty($suggestedTypes)) { |
|
| 64 | + if (!empty($suggestedTypes)) { |
|
| 65 | 65 | $suggestions = Utils::quotedOrList($suggestedTypes); |
| 66 | 66 | |
| 67 | 67 | $message .= sprintf(' Did you mean %s?', $suggestions); |
@@ -22,10 +22,10 @@ discard block |
||
| 22 | 22 | |
| 23 | 23 | return [ |
| 24 | 24 | NodeKind::OPERATION_DEFINITION => [ |
| 25 | - 'enter' => function () { |
|
| 25 | + 'enter' => function() { |
|
| 26 | 26 | $this->variableDefs = []; |
| 27 | 27 | }, |
| 28 | - 'leave' => function (OperationDefinitionNode $operation) use ($context) { |
|
| 28 | + 'leave' => function(OperationDefinitionNode $operation) use ($context) { |
|
| 29 | 29 | $variableNameUsed = []; |
| 30 | 30 | $usages = $context->getRecursiveVariableUsages($operation); |
| 31 | 31 | $opName = $operation->name ? $operation->name->value : null; |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | foreach ($this->variableDefs as $variableDef) { |
| 39 | 39 | $variableName = $variableDef->variable->name->value; |
| 40 | 40 | |
| 41 | - if (! empty($variableNameUsed[$variableName])) { |
|
| 41 | + if (!empty($variableNameUsed[$variableName])) { |
|
| 42 | 42 | continue; |
| 43 | 43 | } |
| 44 | 44 | |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | } |
| 50 | 50 | }, |
| 51 | 51 | ], |
| 52 | - NodeKind::VARIABLE_DEFINITION => function ($def) { |
|
| 52 | + NodeKind::VARIABLE_DEFINITION => function($def) { |
|
| 53 | 53 | $this->variableDefs[] = $def; |
| 54 | 54 | }, |
| 55 | 55 | ]; |
@@ -41,10 +41,10 @@ discard block |
||
| 41 | 41 | $this->spreadPathIndexByName = []; |
| 42 | 42 | |
| 43 | 43 | return [ |
| 44 | - NodeKind::OPERATION_DEFINITION => static function () { |
|
| 44 | + NodeKind::OPERATION_DEFINITION => static function() { |
|
| 45 | 45 | return Visitor::skipNode(); |
| 46 | 46 | }, |
| 47 | - NodeKind::FRAGMENT_DEFINITION => function (FragmentDefinitionNode $node) use ($context) { |
|
| 47 | + NodeKind::FRAGMENT_DEFINITION => function(FragmentDefinitionNode $node) use ($context) { |
|
| 48 | 48 | $this->detectCycleRecursive($node, $context); |
| 49 | 49 | |
| 50 | 50 | return Visitor::skipNode(); |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | |
| 55 | 55 | private function detectCycleRecursive(FragmentDefinitionNode $fragment, ValidationContext $context) |
| 56 | 56 | { |
| 57 | - if (! empty($this->visitedFrags[$fragment->name->value])) { |
|
| 57 | + if (!empty($this->visitedFrags[$fragment->name->value])) { |
|
| 58 | 58 | return; |
| 59 | 59 | } |
| 60 | 60 | |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | } |
| 83 | 83 | } else { |
| 84 | 84 | $cyclePath = array_slice($this->spreadPath, $cycleIndex); |
| 85 | - $fragmentNames = Utils::map(array_slice($cyclePath, 0, -1), static function ($s) { |
|
| 85 | + $fragmentNames = Utils::map(array_slice($cyclePath, 0, -1), static function($s) { |
|
| 86 | 86 | return $s->name->value; |
| 87 | 87 | }); |
| 88 | 88 | |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | return sprintf( |
| 106 | 106 | 'Cannot spread fragment "%s" within itself%s.', |
| 107 | 107 | $fragName, |
| 108 | - ! empty($spreadNames) ? ' via ' . implode(', ', $spreadNames) : '' |
|
| 108 | + !empty($spreadNames) ? ' via ' . implode(', ', $spreadNames) : '' |
|
| 109 | 109 | ); |
| 110 | 110 | } |
| 111 | 111 | } |
@@ -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; |
@@ -15,7 +15,7 @@ |
||
| 15 | 15 | public function getVisitor(ValidationContext $context) |
| 16 | 16 | { |
| 17 | 17 | return [ |
| 18 | - NodeKind::FRAGMENT_SPREAD => static function (FragmentSpreadNode $node) use ($context) { |
|
| 18 | + NodeKind::FRAGMENT_SPREAD => static function(FragmentSpreadNode $node) use ($context) { |
|
| 19 | 19 | $fragmentName = $node->name->value; |
| 20 | 20 | $fragment = $context->getFragment($fragmentName); |
| 21 | 21 | if ($fragment) { |
@@ -34,15 +34,15 @@ |
||
| 34 | 34 | $this->knownArgNames = []; |
| 35 | 35 | |
| 36 | 36 | return [ |
| 37 | - NodeKind::FIELD => function () { |
|
| 37 | + NodeKind::FIELD => function() { |
|
| 38 | 38 | $this->knownArgNames = []; |
| 39 | 39 | }, |
| 40 | - NodeKind::DIRECTIVE => function () { |
|
| 40 | + NodeKind::DIRECTIVE => function() { |
|
| 41 | 41 | $this->knownArgNames = []; |
| 42 | 42 | }, |
| 43 | - NodeKind::ARGUMENT => function (ArgumentNode $node) use ($context) { |
|
| 43 | + NodeKind::ARGUMENT => function(ArgumentNode $node) use ($context) { |
|
| 44 | 44 | $argName = $node->name->value; |
| 45 | - if (! empty($this->knownArgNames[$argName])) { |
|
| 45 | + if (!empty($this->knownArgNames[$argName])) { |
|
| 46 | 46 | $context->reportError(new Error( |
| 47 | 47 | self::duplicateArgMessage($argName), |
| 48 | 48 | [$this->knownArgNames[$argName], $node->name] |
@@ -16,9 +16,9 @@ discard block |
||
| 16 | 16 | public function getVisitor(ValidationContext $context) |
| 17 | 17 | { |
| 18 | 18 | return [ |
| 19 | - NodeKind::FIELD => static function (FieldNode $node) use ($context) { |
|
| 19 | + NodeKind::FIELD => static 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,8 +27,8 @@ |
||
| 27 | 27 | public function getASTVisitor(ASTValidationContext $context) |
| 28 | 28 | { |
| 29 | 29 | return [ |
| 30 | - 'enter' => static function (Node $node) use ($context) { |
|
| 31 | - if (! isset($node->directives)) { |
|
| 30 | + 'enter' => static function(Node $node) use ($context) { |
|
| 31 | + if (!isset($node->directives)) { |
|
| 32 | 32 | return; |
| 33 | 33 | } |
| 34 | 34 | |