Conditions | 2 |
Paths | 2 |
Total Lines | 13 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 2.0116 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
26 | 6 | public function extract($entity) |
|
27 | { |
||
28 | 6 | $entityClassName = (new \ReflectionClass(get_class($entity)))->getShortName(); |
|
29 | 6 | $extractorClassName = __NAMESPACE__ . '\\' . $entityClassName . 'Extractor'; |
|
30 | |||
31 | 6 | if (!class_exists($extractorClassName)) { |
|
32 | throw new UnsupportedEntityException(); |
||
33 | } |
||
34 | |||
35 | /** @var ExtractorInterface $extractor */ |
||
36 | 6 | $extractor = new $extractorClassName($this->router); |
|
37 | 6 | return $extractor->extract($entity); |
|
38 | } |
||
39 | } |
||
40 |