protected function encodeToken($claims, $secret, $hashMethod = 'HS256')
    {
        if (method_exists($encoder = $this->resolveEncoder(), 'encode')) {
            return call_user_func_array(array($encoder, 'encode'), array($claims, $secret, $hashMethod));
        }

        throw new MissingEncoderException('No JSON Web Token encoder could be found');
    }