@@ -58,7 +58,7 @@ |
||
58 | 58 | |
59 | 59 | /** |
60 | 60 | * @param iterable|Definition[] $ir |
61 | - * @return iterable|Definition[] |
|
61 | + * @return \Generator |
|
62 | 62 | * @throws Exception\InternalException |
63 | 63 | */ |
64 | 64 | private function validate(iterable $ir): iterable |
@@ -38,7 +38,7 @@ |
||
38 | 38 | |
39 | 39 | /** |
40 | 40 | * @param Readable $file |
41 | - * @param iterable $ir |
|
41 | + * @param \Generator $ir |
|
42 | 42 | * @return Document |
43 | 43 | */ |
44 | 44 | public function generate(Readable $file, iterable $ir): Document |
@@ -52,7 +52,7 @@ |
||
52 | 52 | } |
53 | 53 | |
54 | 54 | /** |
55 | - * @param null|Readable|File $schema |
|
55 | + * @param null|Readable $schema |
|
56 | 56 | * @return mixed|array|object |
57 | 57 | */ |
58 | 58 | private function loadJsonSchema(?Readable $schema) |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | /** |
25 | 25 | * @var string |
26 | 26 | */ |
27 | - public const RAILT_SDL_1_2 = __DIR__ . '/../../resources/rlsdl-1.2.json'; |
|
27 | + public const RAILT_SDL_1_2 = __DIR__.'/../../resources/rlsdl-1.2.json'; |
|
28 | 28 | |
29 | 29 | /** |
30 | 30 | * @var string |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | $this->validator->reset(); |
75 | 75 | $this->validator->validate($json, $this->schema, Constraint::CHECK_MODE_VALIDATE_SCHEMA); |
76 | 76 | |
77 | - if (! $this->validator->isValid()) { |
|
77 | + if (!$this->validator->isValid()) { |
|
78 | 78 | $error = \implode(\PHP_EOL, [ |
79 | 79 | 'An internal representation code errors was found: ', |
80 | 80 | $this->errorsToString($this->validator->getErrors()), |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | */ |
93 | 93 | private function errorsToString(array $errors): string |
94 | 94 | { |
95 | - $applicator = function (array $error): string { |
|
95 | + $applicator = function(array $error): string { |
|
96 | 96 | if ($error['property']) { |
97 | 97 | return \sprintf(' - [%s] %s.', $error['property'], $error['message']); |
98 | 98 | } |
@@ -17,7 +17,7 @@ |
||
17 | 17 | trait DirectivesProvider |
18 | 18 | { |
19 | 19 | /** |
20 | - * @return iterable|DirectiveValueNode[] |
|
20 | + * @return \Generator |
|
21 | 21 | */ |
22 | 22 | public function getDirectiveNodes(): iterable |
23 | 23 | { |
@@ -23,7 +23,7 @@ |
||
23 | 23 | use DependentNameProvider; |
24 | 24 | |
25 | 25 | /** |
26 | - * @return \Generator|mixed |
|
26 | + * @return \Generator |
|
27 | 27 | */ |
28 | 28 | protected function parse() |
29 | 29 | { |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | */ |
100 | 100 | public function compile(Readable $file): DocumentInterface |
101 | 101 | { |
102 | - return $this->store->memoize($file, function (Readable $file): DocumentInterface { |
|
102 | + return $this->store->memoize($file, function(Readable $file): DocumentInterface { |
|
103 | 103 | return $this->generate($file, $this->ir($file)); |
104 | 104 | }); |
105 | 105 | } |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | */ |
113 | 113 | public function generate(Readable $file, iterable $ir): DocumentInterface |
114 | 114 | { |
115 | - return $this->wrap(function () use ($file, $ir) { |
|
115 | + return $this->wrap(function() use ($file, $ir) { |
|
116 | 116 | return $this->back->run($file, $ir); |
117 | 117 | }); |
118 | 118 | } |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | */ |
146 | 146 | public function ir(Readable $readable): iterable |
147 | 147 | { |
148 | - return $this->wrap(function () use ($readable) { |
|
148 | + return $this->wrap(function() use ($readable) { |
|
149 | 149 | return $this->front->load($readable); |
150 | 150 | }); |
151 | 151 | } |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | /** |
22 | 22 | * @var string |
23 | 23 | */ |
24 | - private const SCHEMA_SDL_GRAMMAR = __DIR__ . '/../../resources/sdl/grammar.pp2'; |
|
24 | + private const SCHEMA_SDL_GRAMMAR = __DIR__.'/../../resources/sdl/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 | } |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | return $this->parseInt($value->getValue()); |
53 | 53 | } |
54 | 54 | |
55 | - return (float)$value->getValue(); |
|
55 | + return (float) $value->getValue(); |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | /** |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | */ |
80 | 80 | private function parseExponential(string $value): float |
81 | 81 | { |
82 | - return (float)$value; |
|
82 | + return (float) $value; |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | /** |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | */ |
89 | 89 | private function parseFloat(string $value): float |
90 | 90 | { |
91 | - return (float)$value; |
|
91 | + return (float) $value; |
|
92 | 92 | } |
93 | 93 | |
94 | 94 | /** |
@@ -10,7 +10,6 @@ |
||
10 | 10 | namespace Railt\SDL\Frontend; |
11 | 11 | |
12 | 12 | use Railt\Io\Readable; |
13 | -use Railt\Parser\Ast\NodeInterface; |
|
14 | 13 | use Railt\Parser\Ast\RuleInterface; |
15 | 14 | use Railt\SDL\Exception\InternalException; |
16 | 15 | use Railt\SDL\Frontend\Builder\BuilderInterface; |