| Conditions | 2 |
| Paths | 2 |
| Total Lines | 11 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 12 | public function resolve(ExecutionEnvironment $environment) |
||
| 13 | { |
||
| 14 | $schema = $environment->getInfo()->getSchema(); |
||
| 15 | // TODO: Benchmark |
||
| 16 | $className = (new \ReflectionClass($environment->getValue()))->getShortName(); |
||
| 17 | |||
| 18 | if (null !== ($type = $schema->getType($className . 'Type'))) { |
||
| 19 | return $type; |
||
| 20 | } |
||
| 21 | |||
| 22 | throw new \Exception(sprintf('Could not resolve type for class "%s".', $className)); |
||
| 23 | } |
||
| 25 |