Conditions | 3 |
Paths | 3 |
Total Lines | 12 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
34 | public function mapNameToType(string $typeName): Type |
||
35 | { |
||
36 | if ($this->schema === null) { |
||
37 | throw new RuntimeException('You must register a schema first before resolving types.'); |
||
38 | } |
||
39 | |||
40 | $type = $this->schema->getType($typeName); |
||
41 | if ($type === null) { |
||
42 | throw CannotMapTypeException::createForName($typeName); |
||
43 | } |
||
44 | |||
45 | return $type; |
||
46 | } |
||
48 |