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