EscolaLMS/Auth

View on GitHub
src/Listeners/EmailAnonymisation.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php

namespace EscolaLms\Auth\Listeners;

use EscolaLms\Auth\Events\AccountDeleted;
use EscolaLms\Auth\Services\Contracts\UserServiceContract;

class EmailAnonymisation
{
    private UserServiceContract $userService;

    public function __construct(UserServiceContract $userService)
    {
        $this->userService = $userService;
    }

    public function handle(AccountDeleted $event): void
    {
        $this->userService->anonymiseEmail($event->getUser());
    }
}