| Total Complexity | 5 |
| Total Lines | 28 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 19 | class ChangePasswordSubscriber implements EventSubscriber |
||
| 20 | { |
||
| 21 | private PasswordService $passwordService; |
||
| 22 | |||
| 23 | public function __construct(PasswordService $passwordService) |
||
| 26 | } |
||
| 27 | |||
| 28 | public function getSubscribedEvents(): array |
||
| 31 | } |
||
| 32 | |||
| 33 | public function preUpdate(LifecycleEventArgs $event): void |
||
| 34 | { |
||
| 35 | $user = $event->getObject(); |
||
| 36 | |||
| 37 | if (!($user instanceof User)) { |
||
| 38 | return; |
||
| 39 | } |
||
| 40 | |||
| 41 | $this->passwordService->processUserPassword($user); |
||
| 42 | } |
||
| 43 | |||
| 44 | public function prePersist(LifecycleEventArgs $event): void |
||
| 47 | } |
||
| 48 | } |
||
| 49 |