@@ -22,7 +22,7 @@ |
||
22 | 22 | class ArgumentSystem extends System |
23 | 23 | { |
24 | 24 | /** |
25 | - * @param Definition|HasArguments $definition |
|
25 | + * @param Definition $definition |
|
26 | 26 | * @param RuleInterface $ast |
27 | 27 | */ |
28 | 28 | public function resolve(Definition $definition, RuleInterface $ast): void |
@@ -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 | } |
@@ -22,7 +22,7 @@ |
||
22 | 22 | class FieldSystem extends System |
23 | 23 | { |
24 | 24 | /** |
25 | - * @param Definition|HasFields $definition |
|
25 | + * @param Definition $definition |
|
26 | 26 | * @param RuleInterface $ast |
27 | 27 | */ |
28 | 28 | public function resolve(Definition $definition, RuleInterface $ast): void |
@@ -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 | } |
@@ -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): 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 | } |
@@ -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 |
@@ -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 | } |
@@ -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"); |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | */ |
94 | 94 | private function renderUtfSequences(string $body): string |
95 | 95 | { |
96 | - $callee = function (array $matches): string { |
|
96 | + $callee = function(array $matches): string { |
|
97 | 97 | [$char, $code] = [$matches[0], $matches[1]]; |
98 | 98 | |
99 | 99 | try { |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | { |
124 | 124 | try { |
125 | 125 | if (\function_exists('\\json_decode')) { |
126 | - $result = @\json_decode('{"char": "' . $body . '"}')->char; |
|
126 | + $result = @\json_decode('{"char": "'.$body.'"}')->char; |
|
127 | 127 | |
128 | 128 | if (\json_last_error() === \JSON_ERROR_NONE) { |
129 | 129 | $body = $result; |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | */ |
144 | 144 | private function renderSpecialCharacters(string $body): string |
145 | 145 | { |
146 | - $callee = function (array $matches): string { |
|
146 | + $callee = function(array $matches): string { |
|
147 | 147 | [$char, $code] = [$matches[0], $matches[1]]; |
148 | 148 | |
149 | 149 | switch ($code) { |