| Conditions | 4 |
| Paths | 5 |
| Total Lines | 14 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 35 | public function onPreUpdate(GenericEvent $event): void |
||
| 36 | { |
||
| 37 | $entity = $event->getArgument('entity'); |
||
| 38 | |||
| 39 | if (!($entity instanceof Domain)) { |
||
| 40 | return; |
||
| 41 | } |
||
| 42 | |||
| 43 | if ('' === $entity->getDkimPrivateKey()) { |
||
| 44 | $entity->setDkimPrivateKey($this->keyGenerationService->createKeyPair()->getPrivate()); |
||
| 45 | } |
||
| 46 | |||
| 47 | if ('' === $entity->getDkimSelector()) { |
||
| 48 | $entity->setDkimSelector(date('Y')); |
||
| 49 | } |
||
| 52 |