@@ -45,7 +45,7 @@ |
||
| 45 | 45 | ]; |
| 46 | 46 | |
| 47 | 47 | /** |
| 48 | - * @param Definition|HasTypeIndication|TypeDefinition $definition |
|
| 48 | + * @param Definition $definition |
|
| 49 | 49 | * @param RuleInterface $ast |
| 50 | 50 | */ |
| 51 | 51 | public function resolve(Definition $definition, RuleInterface $ast): void |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | |
| 56 | 56 | $definition->withModifiers($hint->getModifiers()); |
| 57 | 57 | |
| 58 | - $this->linker(function () use ($hint, $definition) { |
|
| 58 | + $this->linker(function() use ($hint, $definition) { |
|
| 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 | } |
@@ -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) { |
|
| 35 | + $this->deferred(function() use ($definition, $child) { |
|
| 36 | 36 | /** @var DirectiveInvocation $directive */ |
| 37 | 37 | $directive = $this->process->build($child, $definition); |
| 38 | 38 | |
| 39 | - $this->linker(function () use ($definition, $directive) { |
|
| 39 | + $this->linker(function() use ($definition, $directive) { |
|
| 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 | } |
@@ -30,11 +30,11 @@ discard block |
||
| 30 | 30 | { |
| 31 | 31 | if ($document instanceof Document) { |
| 32 | 32 | foreach ($ast as $child) { |
| 33 | - $this->deferred(function () use ($document, $child) { |
|
| 33 | + $this->deferred(function() use ($document, $child) { |
|
| 34 | 34 | $definition = $this->process->build($child, $document); |
| 35 | 35 | |
| 36 | 36 | if ($definition instanceof TypeDefinition) { |
| 37 | - $this->deferred(function () use ($definition, $document) { |
|
| 37 | + $this->deferred(function() use ($definition, $document) { |
|
| 38 | 38 | if ($document->getDictionary()->has($definition->getName())) { |
| 39 | 39 | throw $this->redeclareException($definition); |
| 40 | 40 | } |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | |
| 46 | 46 | |
| 47 | 47 | if ($definition instanceof DirectiveInvocation) { |
| 48 | - $this->complete(function () use ($definition, $document) { |
|
| 48 | + $this->complete(function() use ($definition, $document) { |
|
| 49 | 49 | $document->withDirective($definition); |
| 50 | 50 | }); |
| 51 | 51 | } |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | */ |
| 45 | 45 | private function addLoggerListener(): void |
| 46 | 46 | { |
| 47 | - parent::onTypeNotFound(function (string $type, ?Definition $from): void { |
|
| 47 | + parent::onTypeNotFound(function(string $type, ?Definition $from): void { |
|
| 48 | 48 | if ($this->logger) { |
| 49 | 49 | $direct = 'Try to load type %s from direct method executing'; |
| 50 | 50 | $context = 'Try to load type %s from %s (%s:%d)'; |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | */ |
| 64 | 64 | public function onTypeNotFound(\Closure $then): void |
| 65 | 65 | { |
| 66 | - parent::onTypeNotFound(function (string $type, ?Definition $from) use ($then): void { |
|
| 66 | + parent::onTypeNotFound(function(string $type, ?Definition $from) use ($then) : void { |
|
| 67 | 67 | if (($file = $then($type, $from)) instanceof Readable) { |
| 68 | 68 | $this->compiler->compile($file); |
| 69 | 69 | } |
@@ -48,7 +48,7 @@ |
||
| 48 | 48 | * @param \Closure $exception |
| 49 | 49 | * @return DeferredInterface |
| 50 | 50 | */ |
| 51 | - public function catch(\Closure $exception): DeferredInterface |
|
| 51 | + public function catch (\Closure $exception): DeferredInterface |
|
| 52 | 52 | { |
| 53 | 53 | $this->interceptors->push($exception); |
| 54 | 54 | |
@@ -24,5 +24,5 @@ |
||
| 24 | 24 | * @param \Closure $exception |
| 25 | 25 | * @return DeferredInterface |
| 26 | 26 | */ |
| 27 | - public function catch(\Closure $exception): DeferredInterface; |
|
| 27 | + public function catch (\Closure $exception): DeferredInterface; |
|
| 28 | 28 | } |
@@ -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 | } |
@@ -52,11 +52,11 @@ |
||
| 52 | 52 | |
| 53 | 53 | $output = $this->option('out') ?: \dirname($schema->getPathname()); |
| 54 | 54 | |
| 55 | - if (! \is_dir($output)) { |
|
| 56 | - throw new NotReadableException('Output directory "' . $output . '" not exists'); |
|
| 55 | + if (!\is_dir($output)) { |
|
| 56 | + throw new NotReadableException('Output directory "'.$output.'" not exists'); |
|
| 57 | 57 | } |
| 58 | 58 | |
| 59 | - $outputPathname = $output . '/' . \basename($schema->getPathname()) . '.json'; |
|
| 59 | + $outputPathname = $output.'/'.\basename($schema->getPathname()).'.json'; |
|
| 60 | 60 | |
| 61 | 61 | \file_put_contents($outputPathname, \json_encode($result)); |
| 62 | 62 | } |
@@ -65,11 +65,11 @@ |
||
| 65 | 65 | continue; |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | - $position = $def->getFile()->getPathname() . ':' . $def->getLine(); |
|
| 68 | + $position = $def->getFile()->getPathname().':'.$def->getLine(); |
|
| 69 | 69 | |
| 70 | - $this->writeln('<fg=white;bg=green> ' . \str_repeat(' ', \strlen($position)) . ' </>'); |
|
| 71 | - $this->writeln('<fg=white;bg=green> ' . $position . ' </>'); |
|
| 72 | - $this->writeln('<fg=white;bg=green> ' . \str_repeat(' ', \strlen($position)) . ' </>'); |
|
| 70 | + $this->writeln('<fg=white;bg=green> '.\str_repeat(' ', \strlen($position)).' </>'); |
|
| 71 | + $this->writeln('<fg=white;bg=green> '.$position.' </>'); |
|
| 72 | + $this->writeln('<fg=white;bg=green> '.\str_repeat(' ', \strlen($position)).' </>'); |
|
| 73 | 73 | |
| 74 | 74 | $this->render($def); |
| 75 | 75 | $this->writeln("\n\n"); |