*/ class EventListener implements IEventListener { public function __construct( private ?string $userId = null, ) { } public function handle(Event $event): void { if ($event instanceof NodeWrittenEvent) { // Resize trash if (!empty($this->userId)) { Trashbin::resizeTrash($this->userId); } } // Clean up user specific settings if user gets deleted if ($event instanceof BeforeUserDeletedEvent) { Trashbin::deleteUser($event->getUser()->getUID()); } if ($event instanceof BeforeFileSystemSetupEvent) { Storage::setupStorage(); } } }