for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types = 1);
namespace PersonalGalaxy\Identity\Handler;
use PersonalGalaxy\Identity\{
Command\DeleteIdentity,
Repository\IdentityRepository,
};
final class DeleteIdentityHandler
{
private $repository;
public function __construct(IdentityRepository $repository)
$this->repository = $repository;
}
public function __invoke(DeleteIdentity $wished): void
$identity = $this->repository->get($wished->email());
$identity->delete();
$this->repository->remove($identity->email());