| Conditions | 3 |
| Paths | 2 |
| Total Lines | 13 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 3.0175 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 19 | 2 | public static function registerODMType(string $entityClass, SerializerInterface $serializer): void |
|
| 20 | { |
||
| 21 | 2 | if (!class_exists($entityClass) && !interface_exists($entityClass)) { |
|
| 22 | throw new \DomainException(sprintf('Class or interface "%s" does not exist.', $entityClass)); |
||
| 23 | } |
||
| 24 | |||
| 25 | 2 | $typeName = sprintf('%s[]', $entityClass); |
|
| 26 | 2 | self::addType($typeName, static::class); |
|
| 27 | |||
| 28 | /** @var ODMType $type */ |
||
| 29 | 2 | $type = self::getType($typeName); |
|
| 30 | 2 | $type->setEntityClass($typeName); |
|
| 31 | 2 | $type->setSerializer($serializer); |
|
| 32 | 2 | } |
|
| 34 |