@@ -129,7 +129,7 @@ |
||
129 | 129 | |
130 | 130 | /** |
131 | 131 | * @param array $extensions |
132 | - * @return GraphQLDocument|Document |
|
132 | + * @return Document |
|
133 | 133 | * @throws \OutOfBoundsException |
134 | 134 | */ |
135 | 135 | private function getStandardLibrary(array $extensions = []): GraphQLDocument |
@@ -5,7 +5,7 @@ discard block |
||
5 | 5 | * For the full copyright and license information, please view the LICENSE |
6 | 6 | * file that was distributed with this source code. |
7 | 7 | */ |
8 | -declare(strict_types=1); |
|
8 | +declare(strict_types = 1); |
|
9 | 9 | |
10 | 10 | namespace Railt\SDL; |
11 | 11 | |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | { |
147 | 147 | $this->load($document); |
148 | 148 | |
149 | - $build = function (Definition $definition): void { |
|
149 | + $build = function(Definition $definition): void { |
|
150 | 150 | $this->stack->push($definition); |
151 | 151 | |
152 | 152 | if ($definition instanceof Compilable) { |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | $this->typeCoercion->apply($definition); |
158 | 158 | } |
159 | 159 | |
160 | - if (! ($definition instanceof StandardType)) { |
|
160 | + if (!($definition instanceof StandardType)) { |
|
161 | 161 | $this->typeValidator->group(Definitions::class)->validate($definition); |
162 | 162 | } |
163 | 163 | |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | */ |
229 | 229 | private function onCompile(): \Closure |
230 | 230 | { |
231 | - return function (Readable $readable): Document { |
|
231 | + return function(Readable $readable): Document { |
|
232 | 232 | $ast = $this->parser->parse($readable); |
233 | 233 | |
234 | 234 | return $this->complete(new DocumentBuilder($ast, $readable, $this)); |
@@ -268,7 +268,7 @@ discard block |
||
268 | 268 | public function getPersister(): Storage |
269 | 269 | { |
270 | 270 | \trigger_error( |
271 | - __METHOD__ . ' was renamed to getStorage and will be deleted on next release', |
|
271 | + __METHOD__.' was renamed to getStorage and will be deleted on next release', |
|
272 | 272 | \E_USER_DEPRECATED |
273 | 273 | ); |
274 | 274 |
@@ -104,7 +104,7 @@ |
||
104 | 104 | } |
105 | 105 | |
106 | 106 | /** |
107 | - * @return iterable|Invocable[]|Compilable[] |
|
107 | + * @return \Generator |
|
108 | 108 | */ |
109 | 109 | public function getInvocableTypes(): iterable |
110 | 110 | { |
@@ -5,7 +5,7 @@ |
||
5 | 5 | * For the full copyright and license information, please view the LICENSE |
6 | 6 | * file that was distributed with this source code. |
7 | 7 | */ |
8 | -declare(strict_types=1); |
|
8 | +declare(strict_types = 1); |
|
9 | 9 | |
10 | 10 | namespace Railt\SDL\Reflection\Builder; |
11 | 11 |
@@ -254,7 +254,7 @@ |
||
254 | 254 | * @param NodeInterface $ast |
255 | 255 | * @param string $type |
256 | 256 | * @param array $path |
257 | - * @return array|float|int|null|string |
|
257 | + * @return string |
|
258 | 258 | */ |
259 | 259 | protected function parseValue(NodeInterface $ast, string $type, array $path = []) |
260 | 260 | { |
@@ -5,7 +5,7 @@ discard block |
||
5 | 5 | * For the full copyright and license information, please view the LICENSE |
6 | 6 | * file that was distributed with this source code. |
7 | 7 | */ |
8 | -declare(strict_types=1); |
|
8 | +declare(strict_types = 1); |
|
9 | 9 | |
10 | 10 | namespace Railt\SDL\Reflection\Builder\Process; |
11 | 11 | |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | |
171 | 171 | // Collect sibling methods |
172 | 172 | foreach (\class_uses_recursive(static::class) as $sibling) { |
173 | - $method = 'compile' . \class_basename($sibling); |
|
173 | + $method = 'compile'.\class_basename($sibling); |
|
174 | 174 | |
175 | 175 | if (\method_exists($sibling, $method)) { |
176 | 176 | $this->siblingActions[] = $method; |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | } |
73 | 73 | |
74 | 74 | /** |
75 | - * @param Definition|Compilable $instance |
|
75 | + * @param Definition $instance |
|
76 | 76 | * @return void |
77 | 77 | * @throws TypeConflictException |
78 | 78 | * @throws \OutOfBoundsException |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | } |
226 | 226 | |
227 | 227 | /** |
228 | - * @param HasDirectives|BaseDirectivesContainer $original |
|
228 | + * @param HasDirectives $original |
|
229 | 229 | * @param HasDirectives $extend |
230 | 230 | * @return void |
231 | 231 | * @throws \OutOfBoundsException |
@@ -5,7 +5,7 @@ discard block |
||
5 | 5 | * For the full copyright and license information, please view the LICENSE |
6 | 6 | * file that was distributed with this source code. |
7 | 7 | */ |
8 | -declare(strict_types=1); |
|
8 | +declare(strict_types = 1); |
|
9 | 9 | |
10 | 10 | namespace Railt\SDL\Reflection\Builder\Processable; |
11 | 11 | |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | { |
60 | 60 | $type = DocumentBuilder::AST_TYPE_MAPPING[$ast->getName()] ?? null; |
61 | 61 | |
62 | - if ($type !== null && ! ($type instanceof ExtendDefinition)) { |
|
62 | + if ($type !== null && !($type instanceof ExtendDefinition)) { |
|
63 | 63 | /** @var Compilable $virtualType */ |
64 | 64 | $virtualType = new $type($ast, $this->getDocument()); |
65 | 65 | |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | continue; |
135 | 135 | } |
136 | 136 | |
137 | - $callee = function () use ($extendField): void { |
|
137 | + $callee = function() use ($extendField): void { |
|
138 | 138 | /** @var BaseFieldsContainer $this */ |
139 | 139 | $this->fields[$extendField->getName()] = $extendField; |
140 | 140 | }; |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | private function dataFieldExtender(): \Closure |
150 | 150 | { |
151 | 151 | /** @var FieldDefinition|BaseField $field */ |
152 | - return function (FieldDefinition $field): void { |
|
152 | + return function(FieldDefinition $field): void { |
|
153 | 153 | /** @var BaseField $this */ |
154 | 154 | |
155 | 155 | // Extend type |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | continue; |
192 | 192 | } |
193 | 193 | |
194 | - $callee = function () use ($extendArgument): void { |
|
194 | + $callee = function() use ($extendArgument): void { |
|
195 | 195 | /** @var BaseArgumentsContainer $this */ |
196 | 196 | $this->arguments[$extendArgument->getName()] = $extendArgument; |
197 | 197 | }; |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | private function dataArgumentExtender(): \Closure |
207 | 207 | { |
208 | 208 | /** @var ArgumentDefinition|BaseArgument $argument */ |
209 | - return function (ArgumentDefinition $argument): void { |
|
209 | + return function(ArgumentDefinition $argument): void { |
|
210 | 210 | /** @var BaseArgument $this */ |
211 | 211 | |
212 | 212 | // Extend type |
@@ -241,7 +241,7 @@ discard block |
||
241 | 241 | continue; |
242 | 242 | } |
243 | 243 | |
244 | - $callee = function () use ($extendDirective): void { |
|
244 | + $callee = function() use ($extendDirective): void { |
|
245 | 245 | /** @var BaseArgumentsContainer $this */ |
246 | 246 | $this->arguments[$extendDirective->getName()] = $extendDirective; |
247 | 247 | }; |
@@ -30,7 +30,7 @@ |
||
30 | 30 | } |
31 | 31 | |
32 | 32 | /** |
33 | - * @param TypeDefinition|HasPassedArguments|Invocable $type |
|
33 | + * @param TypeDefinition $type |
|
34 | 34 | */ |
35 | 35 | public function apply(TypeDefinition $type): void |
36 | 36 | { |
@@ -5,7 +5,7 @@ discard block |
||
5 | 5 | * For the full copyright and license information, please view the LICENSE |
6 | 6 | * file that was distributed with this source code. |
7 | 7 | */ |
8 | -declare(strict_types=1); |
|
8 | +declare(strict_types = 1); |
|
9 | 9 | |
10 | 10 | namespace Railt\SDL\Reflection\Coercion; |
11 | 11 | |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | private function inferenceDefaultArguments(HasArguments $container, HasPassedArguments $usage): void |
50 | 50 | { |
51 | 51 | foreach ($container->getArguments() as $argument) { |
52 | - if ($argument->hasDefaultValue() && ! $usage->hasPassedArgument($argument->getName())) { |
|
52 | + if ($argument->hasDefaultValue() && !$usage->hasPassedArgument($argument->getName())) { |
|
53 | 53 | $this->set($usage, $argument->getName(), $argument->getDefaultValue()); |
54 | 54 | } |
55 | 55 | } |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | */ |
63 | 63 | private function set(HasPassedArguments $usage, string $key, $value): void |
64 | 64 | { |
65 | - $invocation = function (string $key, $value): void { |
|
65 | + $invocation = function(string $key, $value): void { |
|
66 | 66 | /** @var BaseInputInvocation $this */ |
67 | 67 | $this->arguments[$key] = $value; |
68 | 68 | }; |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | |
90 | 90 | /** |
91 | 91 | * @param string $type |
92 | - * @return iterable|TypeDefinition[] |
|
92 | + * @return \Generator |
|
93 | 93 | */ |
94 | 94 | public function only(string $type): iterable |
95 | 95 | { |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | } |
102 | 102 | |
103 | 103 | /** |
104 | - * @return iterable|TypeDefinition[] |
|
104 | + * @return \Generator |
|
105 | 105 | */ |
106 | 106 | public function all(): iterable |
107 | 107 | { |
@@ -5,7 +5,7 @@ discard block |
||
5 | 5 | * For the full copyright and license information, please view the LICENSE |
6 | 6 | * file that was distributed with this source code. |
7 | 7 | */ |
8 | -declare(strict_types=1); |
|
8 | +declare(strict_types = 1); |
|
9 | 9 | |
10 | 10 | namespace Railt\SDL\Reflection; |
11 | 11 | |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | */ |
52 | 52 | public function register(TypeDefinition $type, bool $force = false): Dictionary |
53 | 53 | { |
54 | - if (! $force && $this->has($type->getName())) { |
|
54 | + if (!$force && $this->has($type->getName())) { |
|
55 | 55 | $error = \sprintf( |
56 | 56 | 'Can not declare %s, because the name %s already in use', |
57 | 57 | $this->typeToString($type), |
@@ -55,6 +55,7 @@ |
||
55 | 55 | |
56 | 56 | /** |
57 | 57 | * @param array ...$args |
58 | + * @param \Railt\Reflection\Contracts\Definitions\Definition $args |
|
58 | 59 | * @return void |
59 | 60 | * @internal Delegate |
60 | 61 | */ |
@@ -5,7 +5,7 @@ discard block |
||
5 | 5 | * For the full copyright and license information, please view the LICENSE |
6 | 6 | * file that was distributed with this source code. |
7 | 7 | */ |
8 | -declare(strict_types=1); |
|
8 | +declare(strict_types = 1); |
|
9 | 9 | |
10 | 10 | namespace Railt\SDL\Reflection\Validation\Base; |
11 | 11 | |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | */ |
44 | 44 | public function addValidator(string $item): self |
45 | 45 | { |
46 | - if (! \is_subclass_of($item, ValidatorInterface::class)) { |
|
46 | + if (!\is_subclass_of($item, ValidatorInterface::class)) { |
|
47 | 47 | $error = \sprintf('%s must be instance of %s', $item, ValidatorInterface::class); |
48 | 48 | throw new \InvalidArgumentException($error); |
49 | 49 | } |
@@ -34,8 +34,8 @@ discard block |
||
34 | 34 | } |
35 | 35 | |
36 | 36 | /** |
37 | - * @param AllowsTypeIndication|TypeDefinition $child |
|
38 | - * @param AllowsTypeIndication|TypeDefinition $parent |
|
37 | + * @param TypeDefinition $child |
|
38 | + * @param TypeDefinition $parent |
|
39 | 39 | * @return void |
40 | 40 | * @throws TypeConflictException |
41 | 41 | */ |
@@ -52,8 +52,8 @@ discard block |
||
52 | 52 | } |
53 | 53 | |
54 | 54 | /** |
55 | - * @param AllowsTypeIndication|TypeDefinition $child |
|
56 | - * @param AllowsTypeIndication|TypeDefinition $parent |
|
55 | + * @param TypeDefinition $child |
|
56 | + * @param TypeDefinition $parent |
|
57 | 57 | * @return bool |
58 | 58 | */ |
59 | 59 | protected function isEqualType(TypeDefinition $child, TypeDefinition $parent): bool |
@@ -63,8 +63,8 @@ discard block |
||
63 | 63 | } |
64 | 64 | |
65 | 65 | /** |
66 | - * @param AllowsTypeIndication|TypeDefinition $child |
|
67 | - * @param AllowsTypeIndication|TypeDefinition $parent |
|
66 | + * @param TypeDefinition $child |
|
67 | + * @param TypeDefinition $parent |
|
68 | 68 | * @return bool |
69 | 69 | */ |
70 | 70 | protected function isSameType(TypeDefinition $child, TypeDefinition $parent): bool |
@@ -5,7 +5,7 @@ |
||
5 | 5 | * For the full copyright and license information, please view the LICENSE |
6 | 6 | * file that was distributed with this source code. |
7 | 7 | */ |
8 | -declare(strict_types=1); |
|
8 | +declare(strict_types = 1); |
|
9 | 9 | |
10 | 10 | namespace Railt\SDL\Reflection\Validation\Inheritance; |
11 | 11 |
@@ -20,8 +20,8 @@ discard block |
||
20 | 20 | class EnumValidator extends BaseInheritanceValidator |
21 | 21 | { |
22 | 22 | /** |
23 | - * @param AllowsTypeIndication|TypeDefinition $child |
|
24 | - * @param AllowsTypeIndication|TypeDefinition $parent |
|
23 | + * @param TypeDefinition $child |
|
24 | + * @param TypeDefinition $parent |
|
25 | 25 | * @return bool |
26 | 26 | */ |
27 | 27 | public function match(TypeDefinition $child, TypeDefinition $parent): bool |
@@ -31,8 +31,8 @@ discard block |
||
31 | 31 | } |
32 | 32 | |
33 | 33 | /** |
34 | - * @param AllowsTypeIndication|TypeDefinition $child |
|
35 | - * @param AllowsTypeIndication|TypeDefinition $parent |
|
34 | + * @param TypeDefinition $child |
|
35 | + * @param TypeDefinition $parent |
|
36 | 36 | * @return void |
37 | 37 | * @throws TypeConflictException |
38 | 38 | */ |
@@ -5,7 +5,7 @@ discard block |
||
5 | 5 | * For the full copyright and license information, please view the LICENSE |
6 | 6 | * file that was distributed with this source code. |
7 | 7 | */ |
8 | -declare(strict_types=1); |
|
8 | +declare(strict_types = 1); |
|
9 | 9 | |
10 | 10 | namespace Railt\SDL\Reflection\Validation\Inheritance; |
11 | 11 | |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | { |
41 | 41 | \assert($parent->getTypeDefinition() instanceof EnumDefinition); |
42 | 42 | |
43 | - if (! $this->isEqualType($child, $parent)) { |
|
43 | + if (!$this->isEqualType($child, $parent)) { |
|
44 | 44 | $this->throwIncompatibleTypes($child, $parent); |
45 | 45 | } |
46 | 46 | } |