protected function parseCurlOptions($config)
    {
        $options = array();
        $prefix = 'CURLOPT_';
        foreach ($config as $key => $value) {
            $constantName = $prefix . strtoupper($key);
            if (!defined($constantName)) {
                $messageTemplate  = "Invalid option '%s' in apicaller.config parameter. ";
                $messageTemplate .= "Use options (from the cURL section in the PHP manual) without prefix '%s'";
                $message = sprintf($messageTemplate, $key, $prefix);
                throw new \Exception($message);
            }
            $options[constant($constantName)] = $value;
        }

        return $options;
    }
protected function parseCurlOptions($config)
    {
        $options = array();
        $prefix = 'CURLOPT_';
        foreach ($config as $key => $value) {
            $constantName = $prefix . strtoupper($key);
            if (!defined($constantName)) {
                $messageTemplate  = "Invalid option '%s' in apicaller.config parameter. ";
                $messageTemplate .= "Use options (from the cURL section in the PHP manual) without prefix '%s'";
                $message = sprintf($messageTemplate, $key, $prefix);
                throw new \Exception($message);
            }
            $options[constant($constantName)] = $value;
        }

        return $options;
    }
protected function parseCurlOptions ( $ config ) { $ options = array ( ) ; $ prefix = 'CURLOPT_' ; foreach ( $ config as $ key => $ value ) { $ constantName = $ prefix . strtoupper ( $ key ) ; if ( ! defined ( $ constantName ) ) { $ messageTemplate = "Invalid option '%s' in apicaller.config parameter. " ; $ messageTemplate .= "Use options (from the cURL section in the PHP manual) without prefix '%s'" ; $ message = sprintf ( $ messageTemplate , $ key , $ prefix ) ; throw new \ Exception ( $ message ) ; } $ options [ constant ( $ constantName ) ] = $ value ; } return $ options ; }
Private method to parse cURL options from the bundle config.
If some option is not defined an exception will be thrown.

@param array $config ApiCallerBundle configuration

@throws \Exception Specified cURL option can't be found

@return array
Private method to parse cURL options from the bundle config . If some option is not defined an exception will be thrown .