public function login($aPlainPassword, UserPasswordEncoder $anEncoder)
    {
        if (false === $this->isEnabled()) {
            throw new UserInactiveException();
        }
        if (false === $this->password()->equals($aPlainPassword, $anEncoder)) {
            throw new UserPasswordInvalidException();
        }
        $this->lastLogin = new \DateTimeImmutable();

        $this->publish(
            new UserLoggedIn(
                $this->id,
                $this->email
            )
        );
    }