@@ -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 | { |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | |
86 | 86 | /** |
87 | 87 | * @param InterfaceDefinition $definition |
88 | - * @return ProvidesInterfaces |
|
88 | + * @return HasInterfaces |
|
89 | 89 | */ |
90 | 90 | public function withInterface(InterfaceDefinition $definition): ProvidesInterfaces |
91 | 91 | { |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | |
68 | 68 | /** |
69 | 69 | * @param int $value |
70 | - * @return ProvidesTypeIndication |
|
70 | + * @return HasTypeIndication |
|
71 | 71 | */ |
72 | 72 | public function withModifiers(int $value): ProvidesTypeIndication |
73 | 73 | { |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | |
79 | 79 | /** |
80 | 80 | * @param string $name |
81 | - * @return ProvidesTypeIndication |
|
81 | + * @return HasTypeIndication |
|
82 | 82 | */ |
83 | 83 | public function withTypeDefinition(string $name): ProvidesTypeIndication |
84 | 84 | { |
@@ -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 |
@@ -36,21 +36,21 @@ |
||
36 | 36 | |
37 | 37 | public function isAllowedFor(TypeDefinition $definition): bool |
38 | 38 | { |
39 | - throw new \LogicException(__METHOD__ . ' not implemented yet'); |
|
39 | + throw new \LogicException(__METHOD__.' not implemented yet'); |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | public function getLocations(): iterable |
43 | 43 | { |
44 | - throw new \LogicException(__METHOD__ . ' not implemented yet'); |
|
44 | + throw new \LogicException(__METHOD__.' not implemented yet'); |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | public function getLocation(string $name): ?DirectiveLocation |
48 | 48 | { |
49 | - throw new \LogicException(__METHOD__ . ' not implemented yet'); |
|
49 | + throw new \LogicException(__METHOD__.' not implemented yet'); |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | public function hasLocation(string $name): bool |
53 | 53 | { |
54 | - throw new \LogicException(__METHOD__ . ' not implemented yet'); |
|
54 | + throw new \LogicException(__METHOD__.' not implemented yet'); |
|
55 | 55 | } |
56 | 56 | } |
@@ -30,15 +30,15 @@ |
||
30 | 30 | */ |
31 | 31 | public static function getType(): TypeInterface |
32 | 32 | { |
33 | - return Type::of(Type::INTERFACE); |
|
33 | + return Type::of(Type::interface); |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | /** |
37 | 37 | * @param TypeDefinition $definition |
38 | 38 | * @return bool |
39 | 39 | */ |
40 | - public function instanceOf(TypeDefinition $definition): bool |
|
40 | + public function instanceof(TypeDefinition $definition): bool |
|
41 | 41 | { |
42 | - return $this->isImplementsDefinition($definition) || parent::instanceOf($definition); |
|
42 | + return $this->isImplementsDefinition($definition) || parent::instanceof($definition); |
|
43 | 43 | } |
44 | 44 | } |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | /** |
33 | 33 | * @var string |
34 | 34 | */ |
35 | - public const INTERFACE = 'Interface'; |
|
35 | + public const interface = 'Interface'; |
|
36 | 36 | |
37 | 37 | /** |
38 | 38 | * @var string |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | public const ROOT_TYPES = [ |
108 | 108 | self::SCALAR, |
109 | 109 | self::OBJECT, |
110 | - self::INTERFACE, |
|
110 | + self::interface, |
|
111 | 111 | self::UNION, |
112 | 112 | self::ENUM, |
113 | 113 | self::INPUT_OBJECT, |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | */ |
122 | 122 | public const INHERITANCE_TREE = [ |
123 | 123 | self::ANY => [ |
124 | - self::INTERFACE => [ |
|
124 | + self::interface => [ |
|
125 | 125 | self::OBJECT => [ |
126 | 126 | self::INPUT_OBJECT => [ |
127 | 127 | self::DIRECTIVE |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | * @param Type $type |
152 | 152 | * @return bool |
153 | 153 | */ |
154 | - public function instanceOf(Type $type): bool; |
|
154 | + public function instanceof(Type $type): bool; |
|
155 | 155 | |
156 | 156 | /** |
157 | 157 | * @return string |
@@ -50,8 +50,8 @@ |
||
50 | 50 | private function invoke(string $name, TypeDefinition $from = null): void |
51 | 51 | { |
52 | 52 | foreach ($this->callbacks as $callback) { |
53 | - if (! $this->has($name)) { |
|
54 | - $callback($name, $from, function (TypeDefinition $type): void { |
|
53 | + if (!$this->has($name)) { |
|
54 | + $callback($name, $from, function(TypeDefinition $type): void { |
|
55 | 55 | $this->add($type); |
56 | 56 | }); |
57 | 57 | } |