*/ class UserDeleted implements IEventListener { /** @var SyncService */ private $syncService; /** * UserDeleted constructor. * * @param SyncService $syncService */ public function __construct(SyncService $syncService) { $this->syncService = $syncService; } /** * @param Event $event */ public function handle(Event $event): void { if (!($event instanceof UserDeletedEvent)) { return; } $user = $event->getUser(); try { $this->syncService->userDeleted($user->getUID()); } catch (Exception $e) { } } }