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