@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | protected $parents = []; |
| 26 | 26 | |
| 27 | 27 | /** |
| 28 | - * @return iterable|TypeDefinition[] |
|
| 28 | + * @return \Generator |
|
| 29 | 29 | */ |
| 30 | 30 | public function getParents(): iterable |
| 31 | 31 | { |
@@ -54,7 +54,8 @@ discard block |
||
| 54 | 54 | |
| 55 | 55 | /** |
| 56 | 56 | * @param TypeDefinition ...$definitions |
| 57 | - * @return ProvidesInheritance|$this |
|
| 57 | + * @param TypeDefinition[] $definitions |
|
| 58 | + * @return TypeDefinition[] |
|
| 58 | 59 | * @throws TypeConflictException |
| 59 | 60 | */ |
| 60 | 61 | public function extends(TypeDefinition ...$definitions): ProvidesInheritance |
@@ -74,7 +74,7 @@ |
||
| 74 | 74 | */ |
| 75 | 75 | private function verifyExtensionType(TypeDefinition $def): void |
| 76 | 76 | { |
| 77 | - if (! $this::typeOf($def::getType())) { |
|
| 77 | + if (!$this::typeOf($def::getType())) { |
|
| 78 | 78 | $error = \sprintf('Type %s can extends only %s types, but %s given.', $this, static::getType(), $def); |
| 79 | 79 | throw new TypeConflictException($error); |
| 80 | 80 | } |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | /** |
| 53 | - * @return iterable|InterfaceDefinition[] |
|
| 53 | + * @return \Generator |
|
| 54 | 54 | */ |
| 55 | 55 | public function getInterfaces(): iterable |
| 56 | 56 | { |
@@ -79,6 +79,7 @@ discard block |
||
| 79 | 79 | |
| 80 | 80 | /** |
| 81 | 81 | * @param InterfaceDefinition ...$interfaces |
| 82 | + * @param InterfaceDefinition[] $interfaces |
|
| 82 | 83 | * @return ProvidesInterfaces|$this |
| 83 | 84 | */ |
| 84 | 85 | public function implements(InterfaceDefinition ...$interfaces): ProvidesInterfaces |
@@ -12,7 +12,6 @@ |
||
| 12 | 12 | use Railt\Reflection\Contracts\Definition\Behaviour\ProvidesInterfaces; |
| 13 | 13 | use Railt\Reflection\Contracts\Definition\InterfaceDefinition; |
| 14 | 14 | use Railt\Reflection\Contracts\Definition\TypeDefinition; |
| 15 | -use Railt\Reflection\Exception\TypeNotFoundException; |
|
| 16 | 15 | |
| 17 | 16 | /** |
| 18 | 17 | * Trait HasInterfaces |
@@ -67,6 +67,7 @@ |
||
| 67 | 67 | |
| 68 | 68 | /** |
| 69 | 69 | * @param int ...$values |
| 70 | + * @param integer[] $values |
|
| 70 | 71 | * @return ProvidesTypeIndication|$this |
| 71 | 72 | */ |
| 72 | 73 | public function withModifiers(int ...$values): ProvidesTypeIndication |
@@ -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, |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | * @var string[]|array[] |
| 132 | 132 | */ |
| 133 | 133 | public const INHERITANCE_TREE = [ |
| 134 | - self::INTERFACE => [ |
|
| 134 | + self::interface => [ |
|
| 135 | 135 | self::OBJECT => [ |
| 136 | 136 | self::INPUT_OBJECT => [ |
| 137 | 137 | self::DIRECTIVE |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | * @param Type $type |
| 161 | 161 | * @return bool |
| 162 | 162 | */ |
| 163 | - public function instanceOf(Type $type): bool; |
|
| 163 | + public function instanceof(Type $type): bool; |
|
| 164 | 164 | |
| 165 | 165 | /** |
| 166 | 166 | * @param string $type |
@@ -110,7 +110,7 @@ |
||
| 110 | 110 | * @version SDL June 2018 |
| 111 | 111 | * @var string |
| 112 | 112 | */ |
| 113 | - public const INTERFACE = 'INTERFACE'; |
|
| 113 | + public const INTERFACE = 'INTERFACE'; |
|
| 114 | 114 | |
| 115 | 115 | /** |
| 116 | 116 | * @version SDL June 2018 |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | * @version SDL June 2018 |
| 111 | 111 | * @var string |
| 112 | 112 | */ |
| 113 | - public const INTERFACE = 'INTERFACE'; |
|
| 113 | + public const interface = 'INTERFACE'; |
|
| 114 | 114 | |
| 115 | 115 | /** |
| 116 | 116 | * @version SDL June 2018 |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | public const SDL_LOCATIONS = [ |
| 162 | 162 | self::SCALAR, |
| 163 | 163 | self::OBJECT, |
| 164 | - self::INTERFACE, |
|
| 164 | + self::interface, |
|
| 165 | 165 | self::UNION, |
| 166 | 166 | self::ENUM, |
| 167 | 167 | self::INPUT_OBJECT, |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | public const LOCATION_TO_TYPES = [ |
| 182 | 182 | self::SCALAR => Type::SCALAR, |
| 183 | 183 | self::OBJECT => Type::OBJECT, |
| 184 | - self::INTERFACE => Type::INTERFACE, |
|
| 184 | + self::interface => Type::interface, |
|
| 185 | 185 | self::UNION => Type::UNION, |
| 186 | 186 | self::ENUM => Type::ENUM, |
| 187 | 187 | self::INPUT_OBJECT => Type::INPUT_OBJECT, |
@@ -38,7 +38,7 @@ |
||
| 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 | 43 | /** |
| 44 | 44 | * @return Dictionary |
@@ -70,7 +70,7 @@ |
||
| 70 | 70 | */ |
| 71 | 71 | private function bootInheritance(\SplStack $stack, array $children = []): void |
| 72 | 72 | { |
| 73 | - $push = function (string $type) use ($stack): void { |
|
| 73 | + $push = function(string $type) use ($stack): void { |
|
| 74 | 74 | self::$inheritance[$type] = \array_values(\iterator_to_array($stack)); |
| 75 | 75 | self::$inheritance[$type][] = static::ROOT_TYPE; |
| 76 | 76 | |
@@ -114,7 +114,7 @@ |
||
| 114 | 114 | * @param TypeInterface $type |
| 115 | 115 | * @return bool |
| 116 | 116 | */ |
| 117 | - public function instanceOf(TypeInterface $type): bool |
|
| 117 | + public function instanceof(TypeInterface $type): bool |
|
| 118 | 118 | { |
| 119 | 119 | $needle = $type->getName(); |
| 120 | 120 | |
@@ -88,7 +88,7 @@ |
||
| 88 | 88 | * @param TypeDefinition $definition |
| 89 | 89 | * @return bool |
| 90 | 90 | */ |
| 91 | - public function instanceOf(TypeDefinition $definition): bool |
|
| 91 | + public function instanceof(TypeDefinition $definition): bool |
|
| 92 | 92 | { |
| 93 | 93 | if ($definition::getType()->is(Type::ANY)) { |
| 94 | 94 | return true; |
@@ -32,7 +32,7 @@ |
||
| 32 | 32 | /** |
| 33 | 33 | * @var string |
| 34 | 34 | */ |
| 35 | - public const STDLIB_SCHEMA_PATH = __DIR__ . '/../../resources/stdlib.graphqls'; |
|
| 35 | + public const STDLIB_SCHEMA_PATH = __DIR__.'/../../resources/stdlib.graphqls'; |
|
| 36 | 36 | |
| 37 | 37 | /** |
| 38 | 38 | * GraphQLDocument constructor. |