public function register($email, $roles) { if ($this->repository->get($email) instanceof User) { throw UserIsAlreadyRegistered::withEmail($email); } $this->repository->add(new User($email, $roles)); }
public function get($email) { return $this->repository->get($email); }