@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | private $type; |
| 42 | 42 | |
| 43 | 43 | /** |
| 44 | - * @param TypeHint|Definition $type |
|
| 44 | + * @param TypeHint $type |
|
| 45 | 45 | */ |
| 46 | 46 | public function __construct(TypeHint $type) |
| 47 | 47 | { |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | /** |
| 82 | - * @param TypeHint|TypeDefinition $type |
|
| 82 | + * @param TypeHint $type |
|
| 83 | 83 | * @param ValueInterface|ListValueNode $value |
| 84 | 84 | * @return \Traversable |
| 85 | 85 | * @throws \Railt\Io\Exception\ExternalFileException |
@@ -127,8 +127,8 @@ discard block |
||
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | /** |
| 130 | - * @param TypeHint|TypeDefinition $type |
|
| 131 | - * @param ValueInterface|RuleInterface $value |
|
| 130 | + * @param TypeHint $type |
|
| 131 | + * @param ValueInterface $value |
|
| 132 | 132 | * @return mixed |
| 133 | 133 | * @throws \Railt\Io\Exception\ExternalFileException |
| 134 | 134 | */ |
@@ -152,8 +152,8 @@ discard block |
||
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | /** |
| 155 | - * @param TypeHint|TypeDefinition $type |
|
| 156 | - * @param ValueInterface|RuleInterface|InputValueNode $value |
|
| 155 | + * @param TypeHint $type |
|
| 156 | + * @param ValueInterface $value |
|
| 157 | 157 | * @return InputInvocation |
| 158 | 158 | * @throws \Railt\Io\Exception\ExternalFileException |
| 159 | 159 | */ |
@@ -197,8 +197,8 @@ discard block |
||
| 197 | 197 | } |
| 198 | 198 | |
| 199 | 199 | /** |
| 200 | - * @param TypeHint|TypeDefinition|ConstantValueNode $type |
|
| 201 | - * @param ValueInterface|RuleInterface $value |
|
| 200 | + * @param TypeHint $type |
|
| 201 | + * @param ValueInterface $value |
|
| 202 | 202 | * @return mixed |
| 203 | 203 | * @throws \Railt\Io\Exception\ExternalFileException |
| 204 | 204 | */ |
@@ -231,8 +231,8 @@ discard block |
||
| 231 | 231 | } |
| 232 | 232 | |
| 233 | 233 | /** |
| 234 | - * @param TypeHint|TypeDefinition $type |
|
| 235 | - * @param ValueInterface|RuleInterface $value |
|
| 234 | + * @param TypeHint $type |
|
| 235 | + * @param ValueInterface $value |
|
| 236 | 236 | * @return bool|float|int|mixed|null|string |
| 237 | 237 | * @throws \Railt\Io\Exception\ExternalFileException |
| 238 | 238 | * @throws \Railt\Reflection\Exception\TypeNotFoundException |
@@ -251,7 +251,7 @@ discard block |
||
| 251 | 251 | } |
| 252 | 252 | |
| 253 | 253 | /** |
| 254 | - * @param TypeHint|TypeDefinition $type |
|
| 254 | + * @param TypeHint $type |
|
| 255 | 255 | * @param ValueInterface $value |
| 256 | 256 | * @return mixed |
| 257 | 257 | * @throws \Railt\Io\Exception\ExternalFileException |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | /** |
| 103 | 103 | * @validation <name: [Type] = Value> |
| 104 | 104 | */ |
| 105 | - if (! ($value instanceof ListValueNode)) { |
|
| 105 | + if (!($value instanceof ListValueNode)) { |
|
| 106 | 106 | $error = 'Value of %s should be a List, but %s given'; |
| 107 | 107 | throw (new TypeConflictException(\sprintf($error, $type, $value->toString())))->throwsIn($type->getFile(), |
| 108 | 108 | $value->getOffset()); |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | /** |
| 163 | 163 | * @validation <name: InputType = Value> |
| 164 | 164 | */ |
| 165 | - if (! ($value instanceof InputValueNode)) { |
|
| 165 | + if (!($value instanceof InputValueNode)) { |
|
| 166 | 166 | $error = 'Value of %s should be a %s, but %s given'; |
| 167 | 167 | throw (new TypeConflictException(\sprintf($error, $type, $type->getDefinition(), |
| 168 | 168 | $value->toString())))->throwsIn($type->getFile(), $value->getOffset()); |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | /** |
| 185 | 185 | * @validation <name: InputType = {nonExistentField: Value}> |
| 186 | 186 | */ |
| 187 | - if (! $definition->hasField($name)) { |
|
| 187 | + if (!$definition->hasField($name)) { |
|
| 188 | 188 | $error = 'Input field "%s" does not provided by %s, but %s given'; |
| 189 | 189 | throw (new TypeConflictException(\sprintf($error, $name, $type->getDefinition(), |
| 190 | 190 | $value->toString())))->throwsIn($type->getFile(), $value->getOffset()); |
@@ -207,7 +207,7 @@ discard block |
||
| 207 | 207 | /** |
| 208 | 208 | * @validation <name: Enum = "NotEnumValue"> |
| 209 | 209 | */ |
| 210 | - if (! ($value instanceof ConstantValueNode)) { |
|
| 210 | + if (!($value instanceof ConstantValueNode)) { |
|
| 211 | 211 | $error = 'Value of %s can be one of %s value, but %s given'; |
| 212 | 212 | throw (new TypeConflictException(\sprintf($error, $type, $type->getDefinition(), |
| 213 | 213 | $value->toString())))->throwsIn($type->getFile(), $value->getOffset()); |
@@ -221,7 +221,7 @@ discard block |
||
| 221 | 221 | /** |
| 222 | 222 | * @validation <name: Enum = NonExistentValue> |
| 223 | 223 | */ |
| 224 | - if (! $definition->hasValue($name)) { |
|
| 224 | + if (!$definition->hasValue($name)) { |
|
| 225 | 225 | $error = 'Enum %s does not provide value %s'; |
| 226 | 226 | throw (new TypeConflictException(\sprintf($error, $type->getDefinition(), $value->toString()))) |
| 227 | 227 | ->throwsIn($type->getFile(), $value->getOffset()); |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | |
| 100 | 100 | /** |
| 101 | 101 | * @param mixed $value |
| 102 | - * @return iterable|TypeDefinition[] |
|
| 102 | + * @return \Generator |
|
| 103 | 103 | * @throws \Railt\Reflection\Exception\TypeNotFoundException |
| 104 | 104 | */ |
| 105 | 105 | public function resolveType($value): iterable |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | /** |
| 140 | 140 | * @param TypeDefinition $type |
| 141 | 141 | * @param \Closure $filter |
| 142 | - * @return \Generator|TypeDefinition[] |
|
| 142 | + * @return \Generator |
|
| 143 | 143 | */ |
| 144 | 144 | private function getFilteredChildrenInheritance(TypeDefinition $type, \Closure $filter): \Traversable |
| 145 | 145 | { |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | */ |
| 123 | 123 | private function getFilter(): \Closure |
| 124 | 124 | { |
| 125 | - return function (TypeDefinition $resolved): bool { |
|
| 125 | + return function(TypeDefinition $resolved): bool { |
|
| 126 | 126 | return $this->shouldBreak($resolved); |
| 127 | 127 | }; |
| 128 | 128 | } |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | */ |
| 134 | 134 | private function shouldBreak(TypeDefinition $resolved): bool |
| 135 | 135 | { |
| 136 | - return ! isset($this->breakpoints[$resolved->getName()]); |
|
| 136 | + return !isset($this->breakpoints[$resolved->getName()]); |
|
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | /** |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | yield $type; |
| 147 | 147 | |
| 148 | 148 | foreach ($type->getChildrenInheritance() as $child) { |
| 149 | - if (! $filter($child)) { |
|
| 149 | + if (!$filter($child)) { |
|
| 150 | 150 | continue; |
| 151 | 151 | } |
| 152 | 152 | |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | */ |
| 24 | 24 | public function toString(): string |
| 25 | 25 | { |
| 26 | - return (string)$this->toPrimitive(); |
|
| 26 | + return (string) $this->toPrimitive(); |
|
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | /** |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | return $this->parseInt($value->getValue()); |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | - return (float)$value->getValue(); |
|
| 62 | + return (float) $value->getValue(); |
|
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | /** |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | */ |
| 114 | 114 | private function parseExponential(string $value): float |
| 115 | 115 | { |
| 116 | - return (float)$value; |
|
| 116 | + return (float) $value; |
|
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | /** |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | */ |
| 132 | 132 | private function parseFloat(string $value): float |
| 133 | 133 | { |
| 134 | - return (float)$value; |
|
| 134 | + return (float) $value; |
|
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | /** |
@@ -21,7 +21,7 @@ |
||
| 21 | 21 | */ |
| 22 | 22 | public function toPrimitive(): string |
| 23 | 23 | { |
| 24 | - return (string)$this->getChild(0)->getValue(); |
|
| 24 | + return (string) $this->getChild(0)->getValue(); |
|
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | /** |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | */ |
| 22 | 22 | public function toString(): string |
| 23 | 23 | { |
| 24 | - $values = \array_map(function (ValueInterface $value) { |
|
| 24 | + $values = \array_map(function(ValueInterface $value) { |
|
| 25 | 25 | return $value->toString(); |
| 26 | 26 | }, \iterator_to_array($this->getValues())); |
| 27 | 27 | |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | */ |
| 34 | 34 | public function toPrimitive(): iterable |
| 35 | 35 | { |
| 36 | - return \array_map(function (ValueInterface $value) { |
|
| 36 | + return \array_map(function(ValueInterface $value) { |
|
| 37 | 37 | return $value->toPrimitive(); |
| 38 | 38 | }, \iterator_to_array($this->getValues())); |
| 39 | 39 | } |
@@ -43,7 +43,7 @@ |
||
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | /** |
| 46 | - * @return null|ValueInterface|NodeInterface |
|
| 46 | + * @return null|NodeInterface |
|
| 47 | 47 | */ |
| 48 | 48 | public function getDefaultValue(): ?ValueInterface |
| 49 | 49 | { |
@@ -33,11 +33,11 @@ discard block |
||
| 33 | 33 | $directive = new DirectiveInvocation($parent->getDocument(), $rule->getDirectiveName()); |
| 34 | 34 | $directive->withOffset($rule->getOffset()); |
| 35 | 35 | |
| 36 | - $this->when->resolving(function () use ($rule, $directive): void { |
|
| 36 | + $this->when->resolving(function() use ($rule, $directive): void { |
|
| 37 | 37 | /** @var DirectiveDefinition $definition */ |
| 38 | 38 | $definition = $directive->getDefinition(); |
| 39 | 39 | |
| 40 | - if (! ($definition instanceof Definition\DirectiveDefinition)) { |
|
| 40 | + if (!($definition instanceof Definition\DirectiveDefinition)) { |
|
| 41 | 41 | $error = '%s should be a Directive, but %s given'; |
| 42 | 42 | throw (new TypeConflictException(\sprintf($error, $directive, $definition))) |
| 43 | 43 | ->throwsIn($directive->getFile(), $rule->getOffset()); |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | foreach ($rule->getDirectiveArguments() as $ast) { |
| 48 | 48 | $name = $ast->getArgumentName(); |
| 49 | 49 | |
| 50 | - if (! $definition->hasArgument($name)) { |
|
| 50 | + if (!$definition->hasArgument($name)) { |
|
| 51 | 51 | $error = 'Directive %s does not provide argument %s'; |
| 52 | 52 | throw (new TypeConflictException(\sprintf($error, $definition, $name))) |
| 53 | 53 | ->throwsIn($directive->getFile(), $ast->getOffset()); |
@@ -37,13 +37,13 @@ |
||
| 37 | 37 | $object->withField($this->dependent($ast, $object)); |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | - $this->when->resolving(function () use ($rule, $object): void { |
|
| 40 | + $this->when->resolving(function() use ($rule, $object): void { |
|
| 41 | 41 | foreach ($rule->getImplementations() as $interface) { |
| 42 | 42 | $object->withInterface($interface->getTypeName()); |
| 43 | 43 | } |
| 44 | 44 | }); |
| 45 | 45 | |
| 46 | - $this->when->runtime(function () use ($rule, $object): void { |
|
| 46 | + $this->when->runtime(function() use ($rule, $object): void { |
|
| 47 | 47 | foreach ($rule->getDirectives() as $ast) { |
| 48 | 48 | $object->withDirective($this->dependent($ast, $object)); |
| 49 | 49 | } |
@@ -36,7 +36,7 @@ |
||
| 36 | 36 | $enum->withValue($this->dependent($enumValue, $enum)); |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | - $this->when->runtime(function () use ($rule, $enum): void { |
|
| 39 | + $this->when->runtime(function() use ($rule, $enum): void { |
|
| 40 | 40 | foreach ($rule->getDirectives() as $ast) { |
| 41 | 41 | $enum->withDirective($this->dependent($ast, $enum)); |
| 42 | 42 | } |