@@ -28,11 +28,11 @@ |
||
28 | 28 | { |
29 | 29 | if ($ast instanceof ProvidesArgumentNodes) { |
30 | 30 | foreach ($ast->getArgumentNodes() as $child) { |
31 | - $this->deferred(function () use ($definition, $child): void { |
|
31 | + $this->deferred(function() use ($definition, $child): void { |
|
32 | 32 | /** @var Definition\Dependent\ArgumentDefinition $argument */ |
33 | 33 | $argument = $this->process->build($child, $definition); |
34 | 34 | |
35 | - $this->linker(function () use ($definition, $argument): void { |
|
35 | + $this->linker(function() use ($definition, $argument): void { |
|
36 | 36 | if ($definition->hasArgument($argument->getName())) { |
37 | 37 | throw $this->redeclareException($argument); |
38 | 38 | } |
@@ -32,11 +32,11 @@ discard block |
||
32 | 32 | { |
33 | 33 | if ($definition instanceof ProvidesDirectives && $ast instanceof ProvidesDirectiveNodes) { |
34 | 34 | foreach ($ast->getDirectiveNodes() as $child) { |
35 | - $this->deferred(function () use ($definition, $child): void { |
|
35 | + $this->deferred(function() use ($definition, $child): void { |
|
36 | 36 | /** @var DirectiveInvocation $directive */ |
37 | 37 | $directive = $this->process->build($child, $definition); |
38 | 38 | |
39 | - $this->linker(function () use ($definition, $directive): void { |
|
39 | + $this->linker(function() use ($definition, $directive): void { |
|
40 | 40 | $this->validateDefinition($directive); |
41 | 41 | |
42 | 42 | $definition->withDirective($directive); |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | { |
55 | 55 | $definition = $directive->getDefinition(); |
56 | 56 | |
57 | - if (! $definition instanceof DirectiveDefinition) { |
|
57 | + if (!$definition instanceof DirectiveDefinition) { |
|
58 | 58 | $error = \sprintf('Can not use %s as directive', $definition); |
59 | 59 | throw (new TypeConflictException($error))->in($directive); |
60 | 60 | } |
@@ -29,11 +29,11 @@ discard block |
||
29 | 29 | { |
30 | 30 | if ($document instanceof Document) { |
31 | 31 | foreach ($ast as $child) { |
32 | - $this->deferred(function () use ($document, $child): void { |
|
32 | + $this->deferred(function() use ($document, $child): void { |
|
33 | 33 | $definition = $this->process->build($child, $document); |
34 | 34 | |
35 | 35 | if ($definition instanceof TypeDefinition) { |
36 | - $this->deferred(function () use ($definition, $document): void { |
|
36 | + $this->deferred(function() use ($definition, $document): void { |
|
37 | 37 | if ($document->getDictionary()->has($definition->getName())) { |
38 | 38 | throw $this->redeclareException($definition); |
39 | 39 | } |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | |
45 | 45 | |
46 | 46 | if ($definition instanceof DirectiveInvocation) { |
47 | - $this->complete(function () use ($definition, $document): void { |
|
47 | + $this->complete(function() use ($definition, $document): void { |
|
48 | 48 | $document->withDirective($definition); |
49 | 49 | }); |
50 | 50 | } |
@@ -28,11 +28,11 @@ |
||
28 | 28 | { |
29 | 29 | if ($ast instanceof ProvidesFieldNodes) { |
30 | 30 | foreach ($ast->getFieldNodes() as $child) { |
31 | - $this->deferred(function () use ($definition, $child): void { |
|
31 | + $this->deferred(function() use ($definition, $child): void { |
|
32 | 32 | /** @var Definition\Dependent\FieldDefinition $field */ |
33 | 33 | $field = $this->process->build($child, $definition); |
34 | 34 | |
35 | - $this->linker(function () use ($definition, $field): void { |
|
35 | + $this->linker(function() use ($definition, $field): void { |
|
36 | 36 | if ($definition->hasField($field->getName())) { |
37 | 37 | throw $this->redeclareException($field); |
38 | 38 | } |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | |
56 | 56 | $definition->withModifiers($hint->getModifiers()); |
57 | 57 | |
58 | - $this->linker(function () use ($hint, $definition): void { |
|
58 | + $this->linker(function() use ($hint, $definition): void { |
|
59 | 59 | /** @var TypeDefinition $resolved */ |
60 | 60 | $resolved = $this->get($hint->getFullName(), $definition); |
61 | 61 | |
@@ -76,10 +76,10 @@ discard block |
||
76 | 76 | $error = null; |
77 | 77 | |
78 | 78 | switch ($behaviour) { |
79 | - case self::IS_RENDERABLE && ! $hint->isRenderable(): |
|
79 | + case self::IS_RENDERABLE && !$hint->isRenderable(): |
|
80 | 80 | $error = '%s "%s" can contain only renderable type (unions, objects, etc), but %s given'; |
81 | 81 | break; |
82 | - case self::IS_INPUTABLE && ! $hint->isInputable(): |
|
82 | + case self::IS_INPUTABLE && !$hint->isInputable(): |
|
83 | 83 | $error = '%s "%s" can contain only inputable type (inputs, scalars, etc), but %s given'; |
84 | 84 | break; |
85 | 85 | } |
@@ -33,14 +33,14 @@ discard block |
||
33 | 33 | public function resolve(Definition $parent, RuleInterface $ast): void |
34 | 34 | { |
35 | 35 | if ($parent instanceof ProvidesInterfaces && $ast instanceof ProvidesInterfaceNodes) { |
36 | - $this->inference(function () use ($ast, $parent): void { |
|
36 | + $this->inference(function() use ($ast, $parent): void { |
|
37 | 37 | foreach ($ast->getInterfaceNodes() as $node) { |
38 | 38 | $this->implement($parent, $node); |
39 | 39 | } |
40 | 40 | }); |
41 | 41 | |
42 | 42 | if ($parent instanceof ObjectDefinition) { |
43 | - $this->inference(function () use ($parent): void { |
|
43 | + $this->inference(function() use ($parent): void { |
|
44 | 44 | foreach ($parent->getInterfaces() as $interface) { |
45 | 45 | $this->verifyFieldsInheritance($parent, $interface); |
46 | 46 | } |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | */ |
89 | 89 | private function verifyIsInterface(Definition $parent, TypeDefinition $definition): void |
90 | 90 | { |
91 | - if (! $definition instanceof InterfaceDefinition) { |
|
91 | + if (!$definition instanceof InterfaceDefinition) { |
|
92 | 92 | $error = '%s can implement only interfaces, but %s given'; |
93 | 93 | throw new TypeConflictException(\sprintf($error, $parent, $definition)); |
94 | 94 | } |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | private function verifySelfReferenceImplementation(ProvidesInterfaces $parent, TypeDefinition $interface): void |
117 | 117 | { |
118 | 118 | if ($parent->isImplements($parent)) { |
119 | - $error = 'Can not implement the interface %s by %s, ' . |
|
119 | + $error = 'Can not implement the interface %s by %s, '. |
|
120 | 120 | 'because it contains a reference to the already implemented type %s'; |
121 | 121 | $error = \sprintf($error, $interface, $parent, $parent); |
122 | 122 |
@@ -99,7 +99,7 @@ |
||
99 | 99 | */ |
100 | 100 | private function buildDefinition(RuleInterface $rule, DefinitionInterface $parent): DefinitionInterface |
101 | 101 | { |
102 | - if (! $rule instanceof ProvidesDefinition) { |
|
102 | + if (!$rule instanceof ProvidesDefinition) { |
|
103 | 103 | $error = \vsprintf('%s AST should implement %s interface', [ |
104 | 104 | $rule->getName(), ProvidesDefinition::class, ]); |
105 | 105 |
@@ -24,5 +24,5 @@ |
||
24 | 24 | * @param \Closure $exception |
25 | 25 | * @return DeferredInterface |
26 | 26 | */ |
27 | - public function catch(\Closure $exception): self; |
|
27 | + public function catch (\Closure $exception): self; |
|
28 | 28 | } |
@@ -76,11 +76,11 @@ discard block |
||
76 | 76 | |
77 | 77 | $this->logger->debug(\sprintf('Add deferred execution (%s:%d)', $trace['file'], $trace['line'])); |
78 | 78 | |
79 | - $handler->then(function () use ($trace): void { |
|
79 | + $handler->then(function() use ($trace): void { |
|
80 | 80 | $this->logger->debug(\sprintf('Execute deferred handler (%s:%d)', $trace['file'], $trace['line'])); |
81 | 81 | }); |
82 | 82 | |
83 | - $handler->catch(function (\Throwable $e) use ($trace): void { |
|
83 | + $handler->catch(function(\Throwable $e) use ($trace): void { |
|
84 | 84 | $this->logger->debug(\sprintf('Deferred handler rejection (%s:%d)', $trace['file'], $trace['line'])); |
85 | 85 | $this->logger->error($e); |
86 | 86 | |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | $this->log($handler); |
100 | 100 | } |
101 | 101 | |
102 | - if (! \array_key_exists($priority, $this->queue)) { |
|
102 | + if (!\array_key_exists($priority, $this->queue)) { |
|
103 | 103 | $this->queue[$priority] = $this->createCollection(); |
104 | 104 | } |
105 | 105 | |
@@ -121,10 +121,10 @@ discard block |
||
121 | 121 | */ |
122 | 122 | public function count(): int |
123 | 123 | { |
124 | - $accumulator = function (int $result, \SplQueue $queue): int { |
|
124 | + $accumulator = function(int $result, \SplQueue $queue): int { |
|
125 | 125 | return $result + $queue->count(); |
126 | 126 | }; |
127 | 127 | |
128 | - return (int)\array_reduce($this->queue, $accumulator, 0); |
|
128 | + return (int) \array_reduce($this->queue, $accumulator, 0); |
|
129 | 129 | } |
130 | 130 | } |