@@ -67,8 +67,8 @@ discard block |
||
| 67 | 67 | */ |
| 68 | 68 | public function __toString(): string |
| 69 | 69 | { |
| 70 | - $result = $this->getHeader() . \PHP_EOL; |
|
| 71 | - $result .= 'Stack trace:' . \PHP_EOL; |
|
| 70 | + $result = $this->getHeader().\PHP_EOL; |
|
| 71 | + $result .= 'Stack trace:'.\PHP_EOL; |
|
| 72 | 72 | $result .= $this->getFullTraceAsString(); |
| 73 | 73 | |
| 74 | 74 | return $result; |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | |
| 84 | 84 | if ($this->stack) { |
| 85 | 85 | foreach ($this->stack as $def) { |
| 86 | - $result .= \sprintf('#%d %s(%d): %s', $i++, $def->getFile(), $def->getLine(), $def) . \PHP_EOL; |
|
| 86 | + $result .= \sprintf('#%d %s(%d): %s', $i++, $def->getFile(), $def->getLine(), $def).\PHP_EOL; |
|
| 87 | 87 | } |
| 88 | 88 | } |
| 89 | 89 | |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | continue; |
| 93 | 93 | } |
| 94 | 94 | |
| 95 | - $result .= \preg_replace('/#\d+\h/iu', \sprintf('#%d ', $i++), $line) . "\n"; |
|
| 95 | + $result .= \preg_replace('/#\d+\h/iu', \sprintf('#%d ', $i++), $line)."\n"; |
|
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | return $result; |
@@ -37,11 +37,11 @@ |
||
| 37 | 37 | $ast = (new Parser())->parse(File::fromPathname($this->argument('schema'))); |
| 38 | 38 | |
| 39 | 39 | if ($root = $this->option('find')) { |
| 40 | - foreach ($ast->find((string)$root) as $child) { |
|
| 41 | - $this->writeln((string)$child); |
|
| 40 | + foreach ($ast->find((string) $root) as $child) { |
|
| 41 | + $this->writeln((string) $child); |
|
| 42 | 42 | } |
| 43 | 43 | } else { |
| 44 | - $this->writeln((string)$ast); |
|
| 44 | + $this->writeln((string) $ast); |
|
| 45 | 45 | } |
| 46 | 46 | } |
| 47 | 47 | } |
@@ -82,7 +82,7 @@ |
||
| 82 | 82 | */ |
| 83 | 83 | public function autoload(\Closure $then): void |
| 84 | 84 | { |
| 85 | - $this->dictionary->onTypeNotFound(function (string $type, ?Definition $from) use ($then): void { |
|
| 85 | + $this->dictionary->onTypeNotFound(function(string $type, ?Definition $from) use ($then) : void { |
|
| 86 | 86 | if (($file = $then($type, $from)) instanceof Readable) { |
| 87 | 87 | $this->compile($file); |
| 88 | 88 | } |
@@ -11,8 +11,6 @@ discard block |
||
| 11 | 11 | |
| 12 | 12 | use Railt\Io\Readable; |
| 13 | 13 | use Railt\Parser\Ast\RuleInterface; |
| 14 | -use Railt\Parser\Environment; |
|
| 15 | -use Railt\Parser\Exception\UnexpectedTokenException; |
|
| 16 | 14 | use Railt\Parser\Exception\UnrecognizedTokenException; |
| 17 | 15 | use Railt\Reflection\Contracts\Definition; |
| 18 | 16 | use Railt\Reflection\Contracts\Dictionary; |
@@ -22,7 +20,6 @@ discard block |
||
| 22 | 20 | use Railt\Reflection\Document; |
| 23 | 21 | use Railt\Reflection\Reflection; |
| 24 | 22 | use Railt\SDL\Compiler\Parser; |
| 25 | -use Railt\SDL\Compiler\Pipeline; |
|
| 26 | 23 | use Railt\SDL\Compiler\Factory; |
| 27 | 24 | use Railt\SDL\Exception\CompilerException; |
| 28 | 25 | use Railt\SDL\Exception\SyntaxException; |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | */ |
| 75 | 75 | public function push(int $priority, callable $then): void |
| 76 | 76 | { |
| 77 | - if (! \array_key_exists($priority, $this->queue)) { |
|
| 77 | + if (!\array_key_exists($priority, $this->queue)) { |
|
| 78 | 78 | $this->queue[$priority] = $this->createList(); |
| 79 | 79 | } |
| 80 | 80 | |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | */ |
| 95 | 95 | public function count(): int |
| 96 | 96 | { |
| 97 | - return (int)\array_reduce($this->queue, function (int $result, \SplQueue $queue): int { |
|
| 97 | + return (int) \array_reduce($this->queue, function(int $result, \SplQueue $queue): int { |
|
| 98 | 98 | return $result + $queue->count(); |
| 99 | 99 | }, 0); |
| 100 | 100 | } |
@@ -16,7 +16,6 @@ |
||
| 16 | 16 | use Railt\Reflection\Contracts\Definition\TypeDefinition; |
| 17 | 17 | use Railt\Reflection\Contracts\Document; |
| 18 | 18 | use Railt\SDL\Compiler\Ast\TypeNameNode; |
| 19 | -use Railt\SDL\Compiler\Ast\Value\ValueInterface; |
|
| 20 | 19 | |
| 21 | 20 | /** |
| 22 | 21 | * Class TypeDefinitionNode |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | class InputValueNode extends Rule implements ValueInterface, CompositeValueInterface |
| 19 | 19 | { |
| 20 | 20 | /** |
| 21 | - * @return iterable |
|
| 21 | + * @return \Generator |
|
| 22 | 22 | */ |
| 23 | 23 | public function toPrimitive(): iterable |
| 24 | 24 | { |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | /** |
| 31 | - * @return iterable|ValueInterface[] |
|
| 31 | + * @return \Generator |
|
| 32 | 32 | */ |
| 33 | 33 | public function getValues(): iterable |
| 34 | 34 | { |
@@ -7,7 +7,7 @@ discard block |
||
| 7 | 7 | */ |
| 8 | 8 | declare(strict_types=1); |
| 9 | 9 | |
| 10 | -if (! \function_exists('\\sdl')) { |
|
| 10 | +if (!\function_exists('\\sdl')) { |
|
| 11 | 11 | /** |
| 12 | 12 | * @param string $fileOrSources |
| 13 | 13 | * @param bool $filename |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | |
| 28 | -if (! function_exists('trait_uses_recursive')) { |
|
| 28 | +if (!function_exists('trait_uses_recursive')) { |
|
| 29 | 29 | /** |
| 30 | 30 | * Returns all traits used by a trait and its traits. |
| 31 | 31 | * |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | |
| 48 | -if (! function_exists('class_uses_recursive')) { |
|
| 48 | +if (!function_exists('class_uses_recursive')) { |
|
| 49 | 49 | /** |
| 50 | 50 | * Returns all traits used by a class, its parent classes and trait of their traits. |
| 51 | 51 | * |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | |
| 72 | -if (! function_exists('class_basename')) { |
|
| 72 | +if (!function_exists('class_basename')) { |
|
| 73 | 73 | /** |
| 74 | 74 | * Get the class "basename" of the given object / class. |
| 75 | 75 | * |
@@ -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\\Compiler') |
| 46 | - ->saveTo(__DIR__ . '/../Compiler'); |
|
| 46 | + ->saveTo(__DIR__.'/../Compiler'); |
|
| 47 | 47 | |
| 48 | 48 | $this->info('OK'); |
| 49 | 49 | } |
@@ -29,7 +29,7 @@ |
||
| 29 | 29 | /** @var InputDefinition $input */ |
| 30 | 30 | $input = $ast->getTypeDefinition(); |
| 31 | 31 | |
| 32 | - $this->immediately(function () use ($ast, $input) { |
|
| 32 | + $this->immediately(function() use ($ast, $input) { |
|
| 33 | 33 | $input->withOffset($ast->getOffset()); |
| 34 | 34 | $input->withDescription($ast->getDescription()); |
| 35 | 35 | }); |