@@ -40,7 +40,7 @@ |
||
| 40 | 40 | The @include directive may be provided for fields, fragment spreads, and inline |
| 41 | 41 | fragments, and allows for conditional inclusion during execution as described |
| 42 | 42 | by the if argument. |
| 43 | -Description; |
|
| 43 | +description; |
|
| 44 | 44 | |
| 45 | 45 | /** |
| 46 | 46 | * BooleanScalar constructor. |
@@ -55,7 +55,7 @@ |
||
| 55 | 55 | ->withArgument((new ArgumentDefinition($this, 'if', 'Boolean')) |
| 56 | 56 | ->withLine(67) |
| 57 | 57 | ->withModifiers(ArgumentDefinition::IS_NOT_NULL)) |
| 58 | - ->withLocation(...\array_map(function (string $location) use ($document): DirectiveLocation { |
|
| 58 | + ->withLocation(...\array_map(function(string $location) use ($document): DirectiveLocation { |
|
| 59 | 59 | return new DirectiveLocation($this, $location); |
| 60 | 60 | }, self::LOCATIONS)); |
| 61 | 61 | } |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | abstract protected function fetch($type): TypeDefinition; |
| 33 | 33 | |
| 34 | 34 | /** |
| 35 | - * @return iterable|TypeDefinition[] |
|
| 35 | + * @return \Generator |
|
| 36 | 36 | */ |
| 37 | 37 | public function getParents(): iterable |
| 38 | 38 | { |
@@ -61,7 +61,8 @@ discard block |
||
| 61 | 61 | |
| 62 | 62 | /** |
| 63 | 63 | * @param TypeDefinition ...$definitions |
| 64 | - * @return ProvidesInheritance|$this |
|
| 64 | + * @param TypeDefinition[] $definitions |
|
| 65 | + * @return TypeDefinition[] |
|
| 65 | 66 | * @throws TypeConflictException |
| 66 | 67 | */ |
| 67 | 68 | public function extends(TypeDefinition ...$definitions): ProvidesInheritance |
@@ -88,7 +89,7 @@ discard block |
||
| 88 | 89 | } |
| 89 | 90 | |
| 90 | 91 | /** |
| 91 | - * @param string|TypeDefinition $type |
|
| 92 | + * @param TypeDefinition $type |
|
| 92 | 93 | * @return bool |
| 93 | 94 | */ |
| 94 | 95 | public function isExtends($type): bool |
@@ -81,7 +81,7 @@ |
||
| 81 | 81 | */ |
| 82 | 82 | private function verifyExtensionType(TypeDefinition $def): void |
| 83 | 83 | { |
| 84 | - if (! $def::getType()->is(static::getType()->getName())) { |
|
| 84 | + if (!$def::getType()->is(static::getType()->getName())) { |
|
| 85 | 85 | $error = \sprintf('Type %s can extends only %s types, but %s given.', $this, static::getType(), $def); |
| 86 | 86 | throw $this->error(new TypeConflictException($error)); |
| 87 | 87 | } |
@@ -71,6 +71,7 @@ discard block |
||
| 71 | 71 | |
| 72 | 72 | /** |
| 73 | 73 | * @param int ...$values |
| 74 | + * @param integer[] $values |
|
| 74 | 75 | * @return ProvidesTypeIndication|$this |
| 75 | 76 | */ |
| 76 | 77 | public function withModifiers(int ...$values): ProvidesTypeIndication |
@@ -83,7 +84,7 @@ discard block |
||
| 83 | 84 | } |
| 84 | 85 | |
| 85 | 86 | /** |
| 86 | - * @param string|TypeDefinition $type |
|
| 87 | + * @param string $type |
|
| 87 | 88 | * @return ProvidesTypeIndication|$this |
| 88 | 89 | */ |
| 89 | 90 | public function withTypeDefinition($type): ProvidesTypeIndication |
@@ -100,7 +100,7 @@ |
||
| 100 | 100 | public function __toString(): string |
| 101 | 101 | { |
| 102 | 102 | try { |
| 103 | - $parent = (string)$this->getDefinition(); |
|
| 103 | + $parent = (string) $this->getDefinition(); |
|
| 104 | 104 | } catch (\Throwable $e) { |
| 105 | 105 | $parent = '?<?>'; |
| 106 | 106 | } |
@@ -168,7 +168,7 @@ |
||
| 168 | 168 | */ |
| 169 | 169 | protected function error(\Throwable $error): ExternalFileException |
| 170 | 170 | { |
| 171 | - if (! $error instanceof ExternalFileException) { |
|
| 171 | + if (!$error instanceof ExternalFileException) { |
|
| 172 | 172 | $error = new ReflectionException($error->getMessage(), $error->getCode(), $error); |
| 173 | 173 | } |
| 174 | 174 | |
@@ -137,7 +137,7 @@ |
||
| 137 | 137 | */ |
| 138 | 138 | public function getDefinition(string $name): ?TypeDefinition |
| 139 | 139 | { |
| 140 | - if (! \in_array($name, $this->types, true)) { |
|
| 140 | + if (!\in_array($name, $this->types, true)) { |
|
| 141 | 141 | return null; |
| 142 | 142 | } |
| 143 | 143 | |
@@ -49,7 +49,7 @@ |
||
| 49 | 49 | public function __toString(): string |
| 50 | 50 | { |
| 51 | 51 | try { |
| 52 | - $parent = (string)$this->getParentDefinition(); |
|
| 52 | + $parent = (string) $this->getParentDefinition(); |
|
| 53 | 53 | } catch (\Throwable $e) { |
| 54 | 54 | $parent = '?<?>'; |
| 55 | 55 | } |
@@ -31,15 +31,15 @@ |
||
| 31 | 31 | */ |
| 32 | 32 | public static function getType(): TypeInterface |
| 33 | 33 | { |
| 34 | - return Type::of(Type::INTERFACE); |
|
| 34 | + return Type::of(Type::interface); |
|
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | /** |
| 38 | 38 | * @param TypeDefinition $definition |
| 39 | 39 | * @return bool |
| 40 | 40 | */ |
| 41 | - public function instanceOf(TypeDefinition $definition): bool |
|
| 41 | + public function instanceof(TypeDefinition $definition): bool |
|
| 42 | 42 | { |
| 43 | - return $this->isImplements($definition) || parent::instanceOf($definition); |
|
| 43 | + return $this->isImplements($definition) || parent::instanceof($definition); |
|
| 44 | 44 | } |
| 45 | 45 | } |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | /** |
| 38 | 38 | * @var string |
| 39 | 39 | */ |
| 40 | - public const INTERFACE = 'Interface'; |
|
| 40 | + public const interface = 'Interface'; |
|
| 41 | 41 | |
| 42 | 42 | /** |
| 43 | 43 | * @var string |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | public const ROOT_TYPES = [ |
| 114 | 114 | self::SCALAR, |
| 115 | 115 | self::OBJECT, |
| 116 | - self::INTERFACE, |
|
| 116 | + self::interface, |
|
| 117 | 117 | self::UNION, |
| 118 | 118 | self::ENUM, |
| 119 | 119 | self::INPUT_OBJECT, |
@@ -141,7 +141,7 @@ discard block |
||
| 141 | 141 | public const ALLOWS_TO_OUTPUT = [ |
| 142 | 142 | self::SCALAR, |
| 143 | 143 | self::OBJECT, |
| 144 | - self::INTERFACE, |
|
| 144 | + self::interface, |
|
| 145 | 145 | self::UNION, |
| 146 | 146 | self::ENUM, |
| 147 | 147 | self::INPUT_OBJECT, |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | * @var string[]|array[] |
| 159 | 159 | */ |
| 160 | 160 | public const INHERITANCE_TREE = [ |
| 161 | - self::INTERFACE => [ |
|
| 161 | + self::interface => [ |
|
| 162 | 162 | self::OBJECT => [ |
| 163 | 163 | self::INPUT_OBJECT |
| 164 | 164 | ], |
@@ -195,7 +195,7 @@ discard block |
||
| 195 | 195 | * @param Type $type |
| 196 | 196 | * @return bool |
| 197 | 197 | */ |
| 198 | - public function instanceOf(Type $type): bool; |
|
| 198 | + public function instanceof(Type $type): bool; |
|
| 199 | 199 | |
| 200 | 200 | /** |
| 201 | 201 | * @param string $type |
@@ -15,7 +15,6 @@ |
||
| 15 | 15 | use Railt\Reflection\Contracts\Reflection as ReflectionInterface; |
| 16 | 16 | use Railt\Reflection\Dictionary\ProxyDictionary; |
| 17 | 17 | use Railt\Reflection\Dictionary\SimpleDictionary; |
| 18 | -use Railt\Reflection\Exception\ReflectionException; |
|
| 19 | 18 | use Railt\Reflection\Introspection\IntrospectionDocument; |
| 20 | 19 | use Railt\Reflection\Stdlib\StdlibDocument; |
| 21 | 20 | |