*/ class GroupCreated implements IEventListener { /** @var SyncService */ private $syncService; public function __construct(SyncService $syncService) { $this->syncService = $syncService; } public function handle(Event $event): void { if (!($event instanceof GroupCreatedEvent)) { return; } $group = $event->getGroup(); try { $this->syncService->syncNextcloudGroup($group->getGID()); } catch (Exception $e) { } } }