1 | <?php |
||
22 | class Schema |
||
23 | { |
||
24 | /** |
||
25 | * @var \Fubhy\GraphQL\Type\Definition\Types\ObjectType|null |
||
26 | */ |
||
27 | protected $mutationType; |
||
28 | |||
29 | /** |
||
30 | * @var \Fubhy\GraphQL\Type\Definition\Types\ObjectType |
||
31 | */ |
||
32 | protected $queryType; |
||
33 | |||
34 | /** |
||
35 | * @var \Fubhy\GraphQL\Type\Directives\DirectiveInterface[] |
||
36 | */ |
||
37 | protected $directives; |
||
38 | |||
39 | /** |
||
40 | * @var \Fubhy\GraphQL\Type\Definition\Types\TypeInterface[] |
||
41 | */ |
||
42 | protected $typeMap; |
||
43 | |||
44 | /** |
||
45 | * Constructor. |
||
46 | * |
||
47 | * @param \Fubhy\GraphQL\Type\Definition\Types\TypeInterface $queryType |
||
48 | * @param \Fubhy\GraphQL\Type\Definition\Types\TypeInterface|null $mutationType |
||
49 | */ |
||
50 | 309 | public function __construct(TypeInterface $queryType, TypeInterface $mutationType = NULL) |
|
55 | |||
56 | /** |
||
57 | * @return \Fubhy\GraphQL\Type\Definition\Types\ObjectType |
||
58 | */ |
||
59 | 297 | public function getQueryType() |
|
63 | |||
64 | /** |
||
65 | * @return \Fubhy\GraphQL\Type\Definition\Types\ObjectType|null |
||
66 | */ |
||
67 | 162 | public function getMutationType() |
|
71 | |||
72 | /** |
||
73 | * @param string $name |
||
74 | * |
||
75 | * @return \Fubhy\GraphQL\Type\Directives\DirectiveInterface|null |
||
76 | */ |
||
77 | 3 | public function getDirective($name) |
|
86 | |||
87 | /** |
||
88 | * @return \Fubhy\GraphQL\Type\Directives\DirectiveInterface[] |
||
89 | */ |
||
90 | 3 | public function getDirectives() |
|
104 | |||
105 | /** |
||
106 | * @return \Fubhy\GraphQL\Type\Definition\Types\TypeInterface[] |
||
107 | */ |
||
108 | 153 | public function getTypeMap() |
|
123 | |||
124 | /** |
||
125 | * @param string $name |
||
126 | * |
||
127 | * @return \Fubhy\GraphQL\Type\Definition\Types\TypeInterface |
||
128 | */ |
||
129 | 147 | public function getType($name) |
|
134 | |||
135 | /** |
||
136 | * @param \Fubhy\GraphQL\Type\Definition\Types\TypeInterface[] $map |
||
137 | * @param mixed $type |
||
138 | * |
||
139 | * @return \Fubhy\GraphQL\Type\Definition\Types\TypeInterface[] |
||
140 | */ |
||
141 | 153 | protected function typeMapReducer(array $map, $type) |
|
185 | |||
186 | /** |
||
187 | * Re-populate static properties when de-serializing. |
||
188 | */ |
||
189 | public function __wakeup() { |
||
196 | } |
||
197 |
Our type inference engine has found a suspicous assignment of a value to a property. This check raises an issue when a value that can be of a given class or a super-class is assigned to a property that is type hinted more strictly.
Either this assignment is in error or an instanceof check should be added for that assignment.