protected static function buildAuthorizationHeader(string $method, string $token, string $password = null)
    {
        switch ($method) {
            case Client::AUTH_HTTP_PASSWORD:
                return 'Basic '.base64_encode("$token:$password");
            case Client::AUTH_OAUTH_TOKEN:
                return "Bearer $token";
        }

        throw new RuntimeException(sprintf('Authentication method "%s" not implemented.', $method));
    }