@@ -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 | { |
@@ -31,7 +31,7 @@ |
||
31 | 31 | /** |
32 | 32 | * DirectiveInvocationBuilder constructor. |
33 | 33 | * @param NodeInterface $ast |
34 | - * @param DocumentBuilder|Document $document |
|
34 | + * @param DocumentBuilder $document |
|
35 | 35 | * @param TypeDefinition $parent |
36 | 36 | * @throws \Railt\SDL\Exceptions\TypeConflictException |
37 | 37 | */ |
@@ -56,7 +56,7 @@ |
||
56 | 56 | /** @var ArgumentDefinition|null $argument */ |
57 | 57 | $argument = $definition->getArgument($name); |
58 | 58 | |
59 | - if (! $argument) { |
|
59 | + if (!$argument) { |
|
60 | 60 | $this->getCompiler()->getCallStack()->push($definition); |
61 | 61 | |
62 | 62 | $error = \sprintf('Argument %s not defined in %s', $name, $definition); |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | } |
93 | 93 | |
94 | 94 | /** |
95 | - * @return Document|DocumentBuilder |
|
95 | + * @return DocumentBuilder |
|
96 | 96 | */ |
97 | 97 | public function getDocument(): Document |
98 | 98 | { |
@@ -254,7 +254,7 @@ discard block |
||
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 | { |
@@ -170,7 +170,7 @@ |
||
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 |
@@ -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 | { |
@@ -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 | { |
@@ -51,7 +51,7 @@ |
||
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\SDL\Contracts\Definitions\Definition $args |
|
58 | 59 | * @return void |
59 | 60 | * @internal Delegate |
60 | 61 | */ |
@@ -43,7 +43,7 @@ |
||
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 |
@@ -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 | */ |
@@ -40,7 +40,7 @@ |
||
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 | } |