@@ -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 | } |
@@ -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"); |
@@ -52,7 +52,7 @@ |
||
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | /** |
| 55 | - * @param RuleInterface|NodeInterface $rule |
|
| 55 | + * @param null|NodeInterface $rule |
|
| 56 | 56 | * @return \Generator |
| 57 | 57 | */ |
| 58 | 58 | private function analyze(RuleInterface $rule): \Generator |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | */ |
| 71 | 71 | public function isList(): bool |
| 72 | 72 | { |
| 73 | - return (bool)($this->modifiers & Hint::IS_LIST); |
|
| 73 | + return (bool) ($this->modifiers & Hint::IS_LIST); |
|
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | /** |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | */ |
| 79 | 79 | public function isNonNull(): bool |
| 80 | 80 | { |
| 81 | - return (bool)($this->modifiers & Hint::IS_NOT_NULL); |
|
| 81 | + return (bool) ($this->modifiers & Hint::IS_NOT_NULL); |
|
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | /** |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | */ |
| 87 | 87 | public function isListOfNonNulls(): bool |
| 88 | 88 | { |
| 89 | - return (bool)($this->modifiers & Hint::IS_LIST_OF_NOT_NULL); |
|
| 89 | + return (bool) ($this->modifiers & Hint::IS_LIST_OF_NOT_NULL); |
|
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | /** |
@@ -18,7 +18,7 @@ |
||
| 18 | 18 | trait ArgumentsProvider |
| 19 | 19 | { |
| 20 | 20 | /** |
| 21 | - * @return iterable|ArgumentDefinitionNode[] |
|
| 21 | + * @return \Generator |
|
| 22 | 22 | */ |
| 23 | 23 | public function getArgumentNodes(): iterable |
| 24 | 24 | { |
@@ -17,7 +17,7 @@ |
||
| 17 | 17 | trait DirectivesProvider |
| 18 | 18 | { |
| 19 | 19 | /** |
| 20 | - * @return iterable|DirectiveInvocationNode[] |
|
| 20 | + * @return \Generator |
|
| 21 | 21 | */ |
| 22 | 22 | public function getDirectiveNodes(): iterable |
| 23 | 23 | { |
@@ -18,7 +18,7 @@ |
||
| 18 | 18 | trait FieldsProvider |
| 19 | 19 | { |
| 20 | 20 | /** |
| 21 | - * @return iterable|FieldDefinitionNode[] |
|
| 21 | + * @return \Generator |
|
| 22 | 22 | */ |
| 23 | 23 | public function getFieldNodes(): iterable |
| 24 | 24 | { |
@@ -18,7 +18,7 @@ |
||
| 18 | 18 | trait InterfacesProvider |
| 19 | 19 | { |
| 20 | 20 | /** |
| 21 | - * @return iterable|TypeNameNode[] |
|
| 21 | + * @return \Generator |
|
| 22 | 22 | */ |
| 23 | 23 | public function getInterfaceNodes(): iterable |
| 24 | 24 | { |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | /** |
| 22 | 22 | * @var string |
| 23 | 23 | */ |
| 24 | - private const SCHEMA_SDL_GRAMMAR = __DIR__ . '/../../resources/grammar.pp2'; |
|
| 24 | + private const SCHEMA_SDL_GRAMMAR = __DIR__.'/../../resources/grammar.pp2'; |
|
| 25 | 25 | |
| 26 | 26 | /** |
| 27 | 27 | * @var string |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | Compiler::load(File::fromPathname(self::SCHEMA_SDL_GRAMMAR)) |
| 44 | 44 | ->setClassName('Parser') |
| 45 | 45 | ->setNamespace('Railt\\SDL\\Frontend') |
| 46 | - ->saveTo(__DIR__ . '/../Frontend'); |
|
| 46 | + ->saveTo(__DIR__.'/../Frontend'); |
|
| 47 | 47 | |
| 48 | 48 | $this->info('OK'); |
| 49 | 49 | } |