@@ -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] |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | { |
| 24 | 24 | public function getVisitor(ValidationContext $context) |
| 25 | 25 | { |
| 26 | - $skip = function () { |
|
| 26 | + $skip = 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 => function (NamedTypeNode $node) use ($context) { |
|
| 38 | + NodeKind::NAMED_TYPE => 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); |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | public function getVisitor(ValidationContext $context) |
| 25 | 25 | { |
| 26 | 26 | return [ |
| 27 | - NodeKind::ARGUMENT => function (ArgumentNode $node, $key, $parent, $path, $ancestors) use ($context) { |
|
| 27 | + NodeKind::ARGUMENT => function(ArgumentNode $node, $key, $parent, $path, $ancestors) use ($context) { |
|
| 28 | 28 | $argDef = $context->getArgument(); |
| 29 | 29 | if ($argDef !== null) { |
| 30 | 30 | return; |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | Utils::suggestionList( |
| 44 | 44 | $node->name->value, |
| 45 | 45 | array_map( |
| 46 | - function ($arg) { |
|
| 46 | + function($arg) { |
|
| 47 | 47 | return $arg->name; |
| 48 | 48 | }, |
| 49 | 49 | $fieldDef->args |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | Utils::suggestionList( |
| 64 | 64 | $node->name->value, |
| 65 | 65 | array_map( |
| 66 | - function ($arg) { |
|
| 66 | + function($arg) { |
|
| 67 | 67 | return $arg->name; |
| 68 | 68 | }, |
| 69 | 69 | $directive->args |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | public static function unknownArgMessage($argName, $fieldName, $typeName, array $suggestedArgs) |
| 85 | 85 | { |
| 86 | 86 | $message = sprintf('Unknown argument "%s" on field "%s" of type "%s".', $argName, $fieldName, $typeName); |
| 87 | - if (! empty($suggestedArgs)) { |
|
| 87 | + if (!empty($suggestedArgs)) { |
|
| 88 | 88 | $message .= sprintf(' Did you mean %s?', Utils::quotedOrList($suggestedArgs)); |
| 89 | 89 | } |
| 90 | 90 | |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | public static function unknownDirectiveArgMessage($argName, $directiveName, array $suggestedArgs) |
| 98 | 98 | { |
| 99 | 99 | $message = sprintf('Unknown argument "%s" on directive "@%s".', $argName, $directiveName); |
| 100 | - if (! empty($suggestedArgs)) { |
|
| 100 | + if (!empty($suggestedArgs)) { |
|
| 101 | 101 | $message .= sprintf(' Did you mean %s?', Utils::quotedOrList($suggestedArgs)); |
| 102 | 102 | } |
| 103 | 103 | |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | public function getVisitor(ValidationContext $context) |
| 26 | 26 | { |
| 27 | 27 | return [ |
| 28 | - NodeKind::DOCUMENT => function (DocumentNode $node) use ($context) { |
|
| 28 | + NodeKind::DOCUMENT => function(DocumentNode $node) use ($context) { |
|
| 29 | 29 | /** @var Node $definition */ |
| 30 | 30 | foreach ($node->definitions as $definition) { |
| 31 | 31 | if ($definition instanceof OperationDefinitionNode || |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | public function getVisitor(ValidationContext $context) |
| 20 | 20 | { |
| 21 | 21 | return [ |
| 22 | - NodeKind::DIRECTIVE => function (DirectiveNode $node, $key, $parent, $path, $ancestors) use ($context) { |
|
| 22 | + NodeKind::DIRECTIVE => function(DirectiveNode $node, $key, $parent, $path, $ancestors) use ($context) { |
|
| 23 | 23 | $directiveDef = null; |
| 24 | 24 | foreach ($context->getSchema()->getDirectives() as $def) { |
| 25 | 25 | if ($def->name === $node->name->value) { |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | } |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | - if (! $directiveDef) { |
|
| 31 | + if (!$directiveDef) { |
|
| 32 | 32 | $context->reportError(new Error( |
| 33 | 33 | self::unknownDirectiveMessage($node->name->value), |
| 34 | 34 | [$node] |
@@ -38,12 +38,12 @@ discard block |
||
| 38 | 38 | } |
| 39 | 39 | $candidateLocation = $this->getDirectiveLocationForASTPath($ancestors); |
| 40 | 40 | |
| 41 | - if (! $candidateLocation) { |
|
| 41 | + if (!$candidateLocation) { |
|
| 42 | 42 | $context->reportError(new Error( |
| 43 | 43 | self::misplacedDirectiveMessage($node->name->value, $node->type), |
| 44 | 44 | [$node] |
| 45 | 45 | )); |
| 46 | - } elseif (! in_array($candidateLocation, $directiveDef->locations)) { |
|
| 46 | + } elseif (!in_array($candidateLocation, $directiveDef->locations)) { |
|
| 47 | 47 | $context->reportError(new Error( |
| 48 | 48 | self::misplacedDirectiveMessage($node->name->value, $candidateLocation), |
| 49 | 49 | [$node] |