public static function getInstance($method, CURLConfiguration $configuration = null, $resourcePath = null) {

        // Check the configuration.
        if (null === $configuration) {
            $configuration = new CURLConfiguration();
        }

        // Switch into $method.
        switch ($method) {

            case self::HTTP_METHOD_DELETE:
                return new CURLDeleteRequest($configuration, $resourcePath);

            case self::HTTP_METHOD_GET:
                return new CURLGetRequest($configuration, $resourcePath);

            case self::HTTP_METHOD_HEAD:
                return new CURLHeadRequest($configuration, $resourcePath);

            case self::HTTP_METHOD_OPTIONS:
                return new CURLOptionsRequest($configuration, $resourcePath);

            case self::HTTP_METHOD_PATCH:
                return new CURLPatchRequest($configuration, $resourcePath);

            case self::HTTP_METHOD_POST:
                return new CURLPostRequest($configuration, $resourcePath);

            case self::HTTP_METHOD_PUT:
                return new CURLPutRequest($configuration, $resourcePath);

            default:
                throw new InvalidHTTPMethodException($method);
        }
    }
public static function getInstance($method, CURLConfiguration $configuration = null, $resourcePath = null) {

        // Check the configuration.
        if (null === $configuration) {
            $configuration = new CURLConfiguration();
        }

        // Switch into $method.
        switch ($method) {

            case self::HTTP_METHOD_DELETE:
                return new CURLDeleteRequest($configuration, $resourcePath);

            case self::HTTP_METHOD_GET:
                return new CURLGetRequest($configuration, $resourcePath);

            case self::HTTP_METHOD_HEAD:
                return new CURLHeadRequest($configuration, $resourcePath);

            case self::HTTP_METHOD_OPTIONS:
                return new CURLOptionsRequest($configuration, $resourcePath);

            case self::HTTP_METHOD_PATCH:
                return new CURLPatchRequest($configuration, $resourcePath);

            case self::HTTP_METHOD_POST:
                return new CURLPostRequest($configuration, $resourcePath);

            case self::HTTP_METHOD_PUT:
                return new CURLPutRequest($configuration, $resourcePath);

            default:
                throw new InvalidHTTPMethodException($method);
        }
    }
public static function getInstance ( $ method , CURLConfiguration $ configuration = null , $ resourcePath = null ) { // Check the configuration. if ( null === $ configuration ) { $ configuration = new CURLConfiguration ( ) ; } // Switch into $method. switch ( $ method ) { case self :: HTTP_METHOD_DELETE : return new CURLDeleteRequest ( $ configuration , $ resourcePath ) ; case self :: HTTP_METHOD_GET : return new CURLGetRequest ( $ configuration , $ resourcePath ) ; case self :: HTTP_METHOD_HEAD : return new CURLHeadRequest ( $ configuration , $ resourcePath ) ; case self :: HTTP_METHOD_OPTIONS : return new CURLOptionsRequest ( $ configuration , $ resourcePath ) ; case self :: HTTP_METHOD_PATCH : return new CURLPatchRequest ( $ configuration , $ resourcePath ) ; case self :: HTTP_METHOD_POST : return new CURLPostRequest ( $ configuration , $ resourcePath ) ; case self :: HTTP_METHOD_PUT : return new CURLPutRequest ( $ configuration , $ resourcePath ) ; default : throw new InvalidHTTPMethodException ( $ method ) ; } }
Get an instance.

@param string $method The method.
@param CURLConfiguration $configuration The configuration.
@return CURLRequestInterface Returns this request.
@throws InvalidHTTPMethodException Throws an invalid HTTP method exception if the method is not implemented.
Get an instance .