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