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