Conditions | 3 |
Paths | 4 |
Total Lines | 14 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 3.0261 |
Changes | 0 |
1 | <?php |
||
43 | 2 | public function getObjectMapping(string $class): DenormalizationObjectMappingInterface |
|
44 | { |
||
45 | 2 | $reflectionClass = new \ReflectionClass($class); |
|
46 | |||
47 | 2 | if (in_array('Doctrine\Common\Persistence\Proxy', $reflectionClass->getInterfaceNames(), true)) { |
|
48 | $class = $reflectionClass->getParentClass()->name; |
||
49 | } |
||
50 | |||
51 | 2 | if (isset($this->objectMappings[$class])) { |
|
52 | 1 | return $this->objectMappings[$class]; |
|
53 | } |
||
54 | |||
55 | 1 | throw DeserializerLogicException::createMissingMapping($class); |
|
56 | } |
||
57 | } |
||
58 |