@@ -243,7 +243,7 @@ |
||
243 | 243 | |
244 | 244 | /** |
245 | 245 | * @param Readable $readable |
246 | - * @param iterable|RuleInterface[] $rules |
|
246 | + * @param RuleInterface $rules |
|
247 | 247 | * @return iterable|array[] |
248 | 248 | * @throws \Railt\Io\Exception\ExternalFileException |
249 | 249 | */ |
@@ -11,7 +11,6 @@ |
||
11 | 11 | |
12 | 12 | use Railt\Io\Readable; |
13 | 13 | use Railt\Parser\Ast\RuleInterface; |
14 | -use Railt\Parser\Exception\UnexpectedTokenException; |
|
15 | 14 | use Railt\Parser\Exception\UnrecognizedTokenException; |
16 | 15 | use Railt\SDL\Exception\InternalException; |
17 | 16 | use Railt\SDL\Exception\SyntaxException; |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | */ |
141 | 141 | private function bootInterceptors(DeferredStorage $deferred, TypesStorage $types): Factory |
142 | 142 | { |
143 | - $wantsBuild = function (ContextInterface $ctx, RuleInterface $ast) { |
|
143 | + $wantsBuild = function(ContextInterface $ctx, RuleInterface $ast) { |
|
144 | 144 | return $this->buildNode($ctx, $ast); |
145 | 145 | }; |
146 | 146 | |
@@ -278,10 +278,10 @@ discard block |
||
278 | 278 | */ |
279 | 279 | private function deferred(ContextInterface $context): ContextInterface |
280 | 280 | { |
281 | - $this->deferred->attach($this->types->export(function (DefinitionInterface $definition): bool { |
|
281 | + $this->deferred->attach($this->types->export(function(DefinitionInterface $definition): bool { |
|
282 | 282 | $invocation = new Invocation($definition->getName(), $definition->getContext()); |
283 | 283 | |
284 | - return ! $definition->isGeneric() && ! $this->types->resolved($invocation); |
|
284 | + return !$definition->isGeneric() && !$this->types->resolved($invocation); |
|
285 | 285 | })); |
286 | 286 | |
287 | 287 | [$context] = $this->process->run($context, $this->deferred->getIterator()); |
@@ -37,7 +37,7 @@ |
||
37 | 37 | /** |
38 | 38 | * @param ContextInterface $ctx |
39 | 39 | * @param RuleInterface $rule |
40 | - * @return mixed|\Generator|void |
|
40 | + * @return \Generator |
|
41 | 41 | */ |
42 | 42 | public function reduce(ContextInterface $ctx, RuleInterface $rule) |
43 | 43 | { |
@@ -44,7 +44,7 @@ |
||
44 | 44 | /** @var DeferredInterface $definition */ |
45 | 45 | $definition = yield $rule->first('> #TypeDefinition'); |
46 | 46 | |
47 | - $definition->then(function (DefinitionInterface $definition, InvocationInterface $from) { |
|
47 | + $definition->then(function(DefinitionInterface $definition, InvocationInterface $from) { |
|
48 | 48 | /** @var ContextInterface $local */ |
49 | 49 | $local = yield $definition->getLocalContext(); // Open local context |
50 | 50 |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | /** |
41 | 41 | * @param ContextInterface $ctx |
42 | 42 | * @param RuleInterface $rule |
43 | - * @return \Generator|\Closure |
|
43 | + * @return \Generator |
|
44 | 44 | */ |
45 | 45 | public function reduce(ContextInterface $ctx, RuleInterface $rule): \Generator |
46 | 46 | { |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | |
67 | 67 | /** |
68 | 68 | * @param RuleInterface $rule |
69 | - * @return iterable|string[] |
|
69 | + * @return \Generator |
|
70 | 70 | */ |
71 | 71 | private function getVariableNames(RuleInterface $rule): iterable |
72 | 72 | { |
@@ -53,7 +53,7 @@ |
||
53 | 53 | $isConstant ? $record->lock() : $record->unlock(); |
54 | 54 | } |
55 | 55 | |
56 | - yield function () use ($rule, $variables) { |
|
56 | + yield function() use ($rule, $variables) { |
|
57 | 57 | /** @var ValueInterface $value */ |
58 | 58 | $value = yield $this->getValueNode($rule); |
59 | 59 |
@@ -32,8 +32,8 @@ |
||
32 | 32 | |
33 | 33 | /** |
34 | 34 | * @param ContextInterface $ctx |
35 | - * @param RuleInterface|AstValueInterface $rule |
|
36 | - * @return mixed|Value |
|
35 | + * @param RuleInterface $rule |
|
36 | + * @return Value |
|
37 | 37 | */ |
38 | 38 | public function reduce(ContextInterface $ctx, RuleInterface $rule) |
39 | 39 | { |
@@ -43,7 +43,7 @@ |
||
43 | 43 | /** |
44 | 44 | * @param ContextInterface $ctx |
45 | 45 | * @param RuleInterface $rule |
46 | - * @return mixed|Value |
|
46 | + * @return ValueInterface |
|
47 | 47 | */ |
48 | 48 | public function reduce(ContextInterface $ctx, RuleInterface $rule): ValueInterface |
49 | 49 | { |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | /** |
38 | 38 | * @param ContextInterface $ctx |
39 | 39 | * @param RuleInterface $rule |
40 | - * @return \Generator|InvocationInterface |
|
40 | + * @return \Generator |
|
41 | 41 | * @throws TypeConflictException |
42 | 42 | */ |
43 | 43 | public function reduce(ContextInterface $ctx, RuleInterface $rule): \Generator |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | |
68 | 68 | /** |
69 | 69 | * @param ContextInterface $ctx |
70 | - * @param TypeNameInterface|ValueInterface $name |
|
70 | + * @param ValueInterface $name |
|
71 | 71 | * @return InvocationInterface |
72 | 72 | */ |
73 | 73 | private function resolveName(ContextInterface $ctx, $name): InvocationInterface |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | /** |
96 | 96 | * @param ContextInterface $ctx |
97 | 97 | * @param RuleInterface $rule |
98 | - * @return \Generator|TypeNameInterface |
|
98 | + * @return \Generator |
|
99 | 99 | * @throws TypeConflictException |
100 | 100 | */ |
101 | 101 | private function fetchArgumentName(ContextInterface $ctx, RuleInterface $rule): \Generator |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | /** |
124 | 124 | * @param ContextInterface $ctx |
125 | 125 | * @param RuleInterface $rule |
126 | - * @return \Generator|ValueInterface |
|
126 | + * @return \Generator |
|
127 | 127 | */ |
128 | 128 | private function fetchArgumentValue(ContextInterface $ctx, RuleInterface $rule): \Generator |
129 | 129 | { |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | |
82 | 82 | switch (true) { |
83 | 83 | case $isConst: |
84 | - return new Invocation(Name::fromString((string)$name->getValue()), $ctx); |
|
84 | + return new Invocation(Name::fromString((string) $name->getValue()), $ctx); |
|
85 | 85 | |
86 | 86 | case $isType: |
87 | 87 | /** @var Invocation $value */ |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | |
110 | 110 | $isConst = $name->getType()->typeOf(Type::const()); |
111 | 111 | |
112 | - if (! $isConst) { |
|
112 | + if (!$isConst) { |
|
113 | 113 | $error = 'Generic argument name must be a const but %s given'; |
114 | 114 | $exception = new TypeConflictException(\sprintf($error, $name)); |
115 | 115 | $exception->throwsIn($ctx->getFile(), $rule->getOffset()); |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | throw $exception; |
118 | 118 | } |
119 | 119 | |
120 | - return Name::fromString((string)$name->getValue()); |
|
120 | + return Name::fromString((string) $name->getValue()); |
|
121 | 121 | } |
122 | 122 | |
123 | 123 | /** |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | |
133 | 133 | $isType = $value->getType()->typeOf(Type::type()); |
134 | 134 | |
135 | - if (! $isType) { |
|
135 | + if (!$isType) { |
|
136 | 136 | $error = 'Generic argument value must be a valid type, but %s given'; |
137 | 137 | $exception = new TypeConflictException(\sprintf($error, $value)); |
138 | 138 | $exception->throwsIn($ctx->getFile(), $rule->getOffset()); |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | |
46 | 46 | /** |
47 | 47 | * @param mixed ...$args |
48 | - * @return \Generator|mixed |
|
48 | + * @return \Generator |
|
49 | 49 | */ |
50 | 50 | public function __invoke(...$args) |
51 | 51 | { |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | |
55 | 55 | /** |
56 | 56 | * @param array $args |
57 | - * @return \Generator|mixed |
|
57 | + * @return \Generator |
|
58 | 58 | */ |
59 | 59 | public function invoke(...$args): \Generator |
60 | 60 | { |
@@ -9,8 +9,6 @@ |
||
9 | 9 | |
10 | 10 | namespace Railt\SDL\Frontend\Deferred; |
11 | 11 | |
12 | -use Railt\SDL\Frontend\Context\ContextInterface; |
|
13 | - |
|
14 | 12 | /** |
15 | 13 | * Class Deferred |
16 | 14 | */ |
@@ -49,7 +49,7 @@ |
||
49 | 49 | } |
50 | 50 | |
51 | 51 | /** |
52 | - * @return iterable|\Generator |
|
52 | + * @return \Generator |
|
53 | 53 | */ |
54 | 54 | public function getIterator(): iterable |
55 | 55 | { |
@@ -144,7 +144,7 @@ |
||
144 | 144 | |
145 | 145 | /** |
146 | 146 | * @param \Closure $filter |
147 | - * @return \Generator|DeferredInterface[] |
|
147 | + * @return \Generator |
|
148 | 148 | */ |
149 | 149 | public function export(\Closure $filter): \Generator |
150 | 150 | { |
@@ -9,9 +9,7 @@ |
||
9 | 9 | |
10 | 10 | namespace Railt\SDL\Frontend\Definition; |
11 | 11 | |
12 | -use Railt\Reflection\Contracts\Definition\TypeDefinition; |
|
13 | 12 | use Railt\SDL\Exception\NotFoundException; |
14 | -use Railt\SDL\Exception\TypeConflictException; |
|
15 | 13 | use Railt\SDL\Frontend\Context\ContextInterface; |
16 | 14 | use Railt\SDL\Frontend\Deferred\Deferred; |
17 | 15 | use Railt\SDL\Frontend\Deferred\DeferredInterface; |
@@ -53,11 +53,11 @@ discard block |
||
53 | 53 | { |
54 | 54 | $this->naming = $naming; |
55 | 55 | |
56 | - $this->definitions = new Map(function (TypeNameInterface $name): string { |
|
56 | + $this->definitions = new Map(function(TypeNameInterface $name): string { |
|
57 | 57 | return $name->getFullyQualifiedName(); |
58 | 58 | }); |
59 | 59 | |
60 | - $this->resolvers = new Map(function (DefinitionInterface $definition): string { |
|
60 | + $this->resolvers = new Map(function(DefinitionInterface $definition): string { |
|
61 | 61 | return $definition->getName()->getFullyQualifiedName(); |
62 | 62 | }); |
63 | 63 | } |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | */ |
177 | 177 | private function toInvocationDeferredCallback(DefinitionInterface $original, DeferredInterface $then): \Closure |
178 | 178 | { |
179 | - return function (DefinitionInterface $definition = null, InvocationInterface $invocation = null) use ( |
|
179 | + return function(DefinitionInterface $definition = null, InvocationInterface $invocation = null) use ( |
|
180 | 180 | $original, |
181 | 181 | $then |
182 | 182 | ) { |