public function createToken($payload, $secret = null, $algo = null)
    {
        $algo = $algo ?: $this->algorithm();
        $secret = $secret ?: $this->secret();

        if($payload instanceof JwtPayloadInterface) {
            $payload = $payload->getPayload();
        }

        $newToken = $this->jwt->createToken($payload, $secret, $algo);

        $token = clone $this;
        $token->setToken($newToken);

        return $token;
    }