Conditions | 4 |
Paths | 6 |
Total Lines | 16 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 4 |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
28 | public function getObjectMapping(string $class): DenormalizationObjectMappingInterface |
||
29 | { |
||
30 | $reflectionClass = new \ReflectionClass($class); |
||
31 | |||
32 | if (in_array('Doctrine\Common\Persistence\Proxy', $reflectionClass->getInterfaceNames(), true)) { |
||
33 | $reflectionParentClass = (new \ReflectionClass($class))->getParentClass(); |
||
34 | if ($reflectionParentClass instanceof \ReflectionClass) { |
||
35 | 3 | $class = $reflectionParentClass->getName(); |
|
36 | } |
||
37 | 3 | } |
|
38 | |||
39 | 3 | if (isset($this->objectMappings[$class])) { |
|
40 | 1 | return $this->objectMappings[$class]; |
|
41 | 1 | } |
|
42 | 1 | ||
43 | throw DeserializerLogicException::createMissingMapping($class); |
||
44 | } |
||
51 |