*/ class GroupRemovedListener implements IEventListener { public function __construct( private AuthorizedGroupService $authorizedGroupService, ) { } /** * @inheritDoc */ public function handle(Event $event): void { if (!($event instanceof GroupDeletedEvent)) { return; } /** @var GroupDeletedEvent $event */ $this->authorizedGroupService->removeAuthorizationAssociatedTo($event->getGroup()); } }