@@ -80,12 +80,12 @@ |
||
| 80 | 80 | // TODO: rework with generators when PHP minimum required version is changed to 5.5+ |
| 81 | 81 | $promisesOrValues = Utils::map( |
| 82 | 82 | $promisesOrValues, |
| 83 | - static function ($item) { |
|
| 83 | + static function($item) { |
|
| 84 | 84 | return $item instanceof Promise ? $item->adoptedPromise : $item; |
| 85 | 85 | } |
| 86 | 86 | ); |
| 87 | 87 | |
| 88 | - $promise = all($promisesOrValues)->then(static function ($values) use ($promisesOrValues) { |
|
| 88 | + $promise = all($promisesOrValues)->then(static function($values) use ($promisesOrValues) { |
|
| 89 | 89 | $orderedResults = []; |
| 90 | 90 | |
| 91 | 91 | foreach ($promisesOrValues as $key => $value) { |
@@ -25,17 +25,17 @@ discard block |
||
| 25 | 25 | |
| 26 | 26 | return [ |
| 27 | 27 | NodeKind::OPERATION_DEFINITION => [ |
| 28 | - 'enter' => static function () use (&$variableNameDefined) { |
|
| 28 | + 'enter' => static function() use (&$variableNameDefined) { |
|
| 29 | 29 | $variableNameDefined = []; |
| 30 | 30 | }, |
| 31 | - 'leave' => static function (OperationDefinitionNode $operation) use (&$variableNameDefined, $context) { |
|
| 31 | + 'leave' => static function(OperationDefinitionNode $operation) use (&$variableNameDefined, $context) { |
|
| 32 | 32 | $usages = $context->getRecursiveVariableUsages($operation); |
| 33 | 33 | |
| 34 | 34 | foreach ($usages as $usage) { |
| 35 | 35 | $node = $usage['node']; |
| 36 | 36 | $varName = $node->name->value; |
| 37 | 37 | |
| 38 | - if (! empty($variableNameDefined[$varName])) { |
|
| 38 | + if (!empty($variableNameDefined[$varName])) { |
|
| 39 | 39 | continue; |
| 40 | 40 | } |
| 41 | 41 | |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | } |
| 50 | 50 | }, |
| 51 | 51 | ], |
| 52 | - NodeKind::VARIABLE_DEFINITION => static function (VariableDefinitionNode $def) use (&$variableNameDefined) { |
|
| 52 | + NodeKind::VARIABLE_DEFINITION => static function(VariableDefinitionNode $def) use (&$variableNameDefined) { |
|
| 53 | 53 | $variableNameDefined[$def->variable->name->value] = true; |
| 54 | 54 | }, |
| 55 | 55 | ]; |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | |
| 39 | 39 | foreach ($definedDirectives as $directive) { |
| 40 | 40 | $directiveArgs[$directive->name] = array_map( |
| 41 | - static function (FieldArgument $arg) : string { |
|
| 41 | + static function(FieldArgument $arg) : string { |
|
| 42 | 42 | return $arg->name; |
| 43 | 43 | }, |
| 44 | 44 | $directive->args |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | |
| 48 | 48 | $astDefinitions = $context->getDocument()->definitions; |
| 49 | 49 | foreach ($astDefinitions as $def) { |
| 50 | - if (! ($def instanceof DirectiveDefinitionNode)) { |
|
| 50 | + if (!($def instanceof DirectiveDefinitionNode)) { |
|
| 51 | 51 | continue; |
| 52 | 52 | } |
| 53 | 53 | |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | $arguments = iterator_to_array($arguments->getIterator()); |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | - $directiveArgs[$name] = array_map(static function (InputValueDefinitionNode $arg) : string { |
|
| 62 | + $directiveArgs[$name] = array_map(static function(InputValueDefinitionNode $arg) : string { |
|
| 63 | 63 | return $arg->name->value; |
| 64 | 64 | }, $arguments); |
| 65 | 65 | } else { |
@@ -68,11 +68,11 @@ discard block |
||
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | return [ |
| 71 | - NodeKind::DIRECTIVE => static function (DirectiveNode $directiveNode) use ($directiveArgs, $context) { |
|
| 71 | + NodeKind::DIRECTIVE => static function(DirectiveNode $directiveNode) use ($directiveArgs, $context) { |
|
| 72 | 72 | $directiveName = $directiveNode->name->value; |
| 73 | 73 | $knownArgs = $directiveArgs[$directiveName] ?? null; |
| 74 | 74 | |
| 75 | - if ($directiveNode->arguments === null || ! $knownArgs) { |
|
| 75 | + if ($directiveNode->arguments === null || !$knownArgs) { |
|
| 76 | 76 | return; |
| 77 | 77 | } |
| 78 | 78 | |
@@ -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) { |
@@ -22,10 +22,10 @@ |
||
| 22 | 22 | $this->knownFragmentNames = []; |
| 23 | 23 | |
| 24 | 24 | return [ |
| 25 | - NodeKind::OPERATION_DEFINITION => static function () { |
|
| 25 | + NodeKind::OPERATION_DEFINITION => static 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; |
@@ -33,12 +33,12 @@ discard block |
||
| 33 | 33 | $astDefinition = $context->getDocument()->definitions; |
| 34 | 34 | |
| 35 | 35 | foreach ($astDefinition as $def) { |
| 36 | - if (! ($def instanceof DirectiveDefinitionNode)) { |
|
| 36 | + if (!($def instanceof DirectiveDefinitionNode)) { |
|
| 37 | 37 | continue; |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | $locationsMap[$def->name->value] = array_map( |
| 41 | - static function ($name) { |
|
| 41 | + static function($name) { |
|
| 42 | 42 | return $name->value; |
| 43 | 43 | }, |
| 44 | 44 | $def->locations |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | return [ |
| 49 | - NodeKind::DIRECTIVE => function ( |
|
| 49 | + NodeKind::DIRECTIVE => function( |
|
| 50 | 50 | DirectiveNode $node, |
| 51 | 51 | $key, |
| 52 | 52 | $parent, |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | $name = $node->name->value; |
| 60 | 60 | $locations = $locationsMap[$name] ?? null; |
| 61 | 61 | |
| 62 | - if (! $locations) { |
|
| 62 | + if (!$locations) { |
|
| 63 | 63 | $context->reportError(new Error( |
| 64 | 64 | self::unknownDirectiveMessage($name), |
| 65 | 65 | [$node] |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | |
| 71 | 71 | $candidateLocation = $this->getDirectiveLocationForASTPath($ancestors); |
| 72 | 72 | |
| 73 | - if (! $candidateLocation || in_array($candidateLocation, $locations, true)) { |
|
| 73 | + if (!$candidateLocation || in_array($candidateLocation, $locations, true)) { |
|
| 74 | 74 | return; |
| 75 | 75 | } |
| 76 | 76 | $context->reportError( |
@@ -19,13 +19,13 @@ discard block |
||
| 19 | 19 | public function getVisitor(ValidationContext $context) |
| 20 | 20 | { |
| 21 | 21 | return [ |
| 22 | - NodeKind::INLINE_FRAGMENT => static function (InlineFragmentNode $node) use ($context) { |
|
| 23 | - if (! $node->typeCondition) { |
|
| 22 | + NodeKind::INLINE_FRAGMENT => static 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 => static function (FragmentDefinitionNode $node) use ($context) { |
|
| 37 | + NodeKind::FRAGMENT_DEFINITION => static 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 | |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | protected function invokeIfNeeded(ValidationContext $context, array $validators) |
| 65 | 65 | { |
| 66 | 66 | // is disabled? |
| 67 | - if (! $this->isEnabled()) { |
|
| 67 | + if (!$this->isEnabled()) { |
|
| 68 | 68 | return []; |
| 69 | 69 | } |
| 70 | 70 | |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | // Importantly this does not include inline fragments. |
| 82 | 82 | $definitions = $context->getDocument()->definitions; |
| 83 | 83 | foreach ($definitions as $node) { |
| 84 | - if (! ($node instanceof FragmentDefinitionNode)) { |
|
| 84 | + if (!($node instanceof FragmentDefinitionNode)) { |
|
| 85 | 85 | continue; |
| 86 | 86 | } |
| 87 | 87 | |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | } |
| 137 | 137 | } |
| 138 | 138 | $responseName = $this->getFieldName($selection); |
| 139 | - if (! isset($_astAndDefs[$responseName])) { |
|
| 139 | + if (!isset($_astAndDefs[$responseName])) { |
|
| 140 | 140 | $_astAndDefs[$responseName] = new ArrayObject(); |
| 141 | 141 | } |
| 142 | 142 | // create field context |
@@ -31,7 +31,7 @@ |
||
| 31 | 31 | return $this->invokeIfNeeded( |
| 32 | 32 | $context, |
| 33 | 33 | [ |
| 34 | - NodeKind::FIELD => static function (FieldNode $node) use ($context) { |
|
| 34 | + NodeKind::FIELD => static function(FieldNode $node) use ($context) { |
|
| 35 | 35 | if ($node->name->value !== '__type' && $node->name->value !== '__schema') { |
| 36 | 36 | return; |
| 37 | 37 | } |