public function execute($type)
    {
        switch (strtolower($type)) {
        case 'markup':
            $curlOptArray = $this->getMarkupOpts();
            break;

        case 'file':
            $curlOptArray = $this->getFileOpts();
            break;

        case 'url':
            $curlOptArray = $this->getUrlOpts();
            break;

        default:
            throw new \PHPUnit_Framework_Exception('Invalid type: '.$type);
            break;
        }

        $curlOptArray = $curlOptArray + array(CURLOPT_RETURNTRANSFER => true,
                                              CURLOPT_TIMEOUT => 10, );

        // Throttle calls (if necessary).
        Throttle::delay(get_class($this));

        $curl = curl_init();
        curl_setopt_array($curl, $curlOptArray);

        if (!$response = curl_exec($curl)) {
            throw new \PHPUnit_Framework_Exception('Unable to validate. Error: '.
                                                   curl_error($curl));
        }

        curl_close($curl);

        return $response;
    }
public function execute($type)
    {
        switch (strtolower($type)) {
        case 'markup':
            $curlOptArray = $this->getMarkupOpts();
            break;

        case 'file':
            $curlOptArray = $this->getFileOpts();
            break;

        case 'url':
            $curlOptArray = $this->getUrlOpts();
            break;

        default:
            throw new \PHPUnit_Framework_Exception('Invalid type: '.$type);
            break;
        }

        $curlOptArray = $curlOptArray + array(CURLOPT_RETURNTRANSFER => true,
                                              CURLOPT_TIMEOUT => 10, );

        // Throttle calls (if necessary).
        Throttle::delay(get_class($this));

        $curl = curl_init();
        curl_setopt_array($curl, $curlOptArray);

        if (!$response = curl_exec($curl)) {
            throw new \PHPUnit_Framework_Exception('Unable to validate. Error: '.
                                                   curl_error($curl));
        }

        curl_close($curl);

        return $response;
    }
public function execute ( $ type ) { switch ( strtolower ( $ type ) ) { case 'markup' : $ curlOptArray = $ this -> getMarkupOpts ( ) ; break ; case 'file' : $ curlOptArray = $ this -> getFileOpts ( ) ; break ; case 'url' : $ curlOptArray = $ this -> getUrlOpts ( ) ; break ; default : throw new \ PHPUnit_Framework_Exception ( 'Invalid type: ' . $ type ) ; break ; } $ curlOptArray = $ curlOptArray + array ( CURLOPT_RETURNTRANSFER => true , CURLOPT_TIMEOUT => 10 , ) ; // Throttle calls (if necessary). Throttle :: delay ( get_class ( $ this ) ) ; $ curl = curl_init ( ) ; curl_setopt_array ( $ curl , $ curlOptArray ) ; if ( ! $ response = curl_exec ( $ curl ) ) { throw new \ PHPUnit_Framework_Exception ( 'Unable to validate. Error: ' . curl_error ( $ curl ) ) ; } curl_close ( $ curl ) ; return $ response ; }
Will execute a cURL request.

@param string $type The type of input.

@return mixed The response from the web service.
Will execute a cURL request .