| Conditions | 3 |
| Paths | 3 |
| Total Lines | 14 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 5 |
| CRAP Score | 3.2098 |
| Changes | 0 | ||
| 1 | <?php |
||
| 51 | 1 | public function denormalize($identifier, $class) |
|
| 52 | { |
||
| 53 | 1 | $manager = $this->registry->getManagerForClass($class); |
|
| 54 | |||
| 55 | 1 | if (null === $manager) { |
|
| 56 | throw new \RuntimeException('Not supported class ' . $class); |
||
| 57 | } |
||
| 58 | |||
| 59 | 1 | if ($manager instanceof EntityManagerInterface) { |
|
| 60 | 1 | return $manager->getReference($class, $identifier); |
|
| 61 | } |
||
| 62 | |||
| 63 | return $manager->find($class, $identifier); |
||
| 64 | } |
||
| 65 | } |
||
| 66 |