Skip to content

Commit

Permalink
fixed indention
Browse files Browse the repository at this point in the history
  • Loading branch information
Baachi committed Dec 5, 2011
1 parent 0be49a6 commit c77cf9a
Showing 1 changed file with 40 additions and 46 deletions.
86 changes: 40 additions & 46 deletions lib/Doctrine/Search/Http/Client/CurlClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,51 +65,45 @@ public function sendRequest($method = 'get', $path = '/', $data = '')
}

private function getCurlMethod($method)
{

$curlMethodValue = true;

switch(strtoupper($method))
{
case 'GET':
$curlMethod = CURLOPT_HTTPGET;
break;

case 'POST':
$curlMethod = CURLOPT_POST;
break;

case 'PUT':
$curlMethod = CURLOPT_CUSTOMREQUEST;
$curlMethodValue = "PUT";
break;

case 'DELETE' :
$curlMethod = CURLOPT_CUSTOMREQUEST;
$curlMethodValue = "DELETE";
break;

case 'OPTIONS' :
$curlMethod = CURLOPT_CUSTOMREQUEST;
$curlMethodValue = "OPTIONS";
break;

case 'TRACE' :
$curlMethod = CURLOPT_CUSTOMREQUEST;
$curlMethodValue = "TRACE";
break;

case 'HEAD' :
$curlMethod = CURLOPT_CUSTOMREQUEST;
$curlMethodValue = "HEAD";
break;

default:
throw new AdapterInvalidArgumentException('Method '. strtoupper($method) .' is not supported');

}

return array($curlMethod, $curlMethodValue);
}
{
$curlMethodValue = true;
switch (strtoupper($method)) {
case 'GET':
$curlMethod = CURLOPT_HTTPGET;
break;

case 'POST':
$curlMethod = CURLOPT_POST;
break;

case 'PUT':
$curlMethod = CURLOPT_CUSTOMREQUEST;
$curlMethodValue = "PUT";
break;

case 'DELETE' :
$curlMethod = CURLOPT_CUSTOMREQUEST;
$curlMethodValue = "DELETE";
break;

case 'OPTIONS' :
$curlMethod = CURLOPT_CUSTOMREQUEST;
$curlMethodValue = "OPTIONS";
break;

case 'TRACE' :
$curlMethod = CURLOPT_CUSTOMREQUEST;
$curlMethodValue = "TRACE";
break;

case 'HEAD' :
$curlMethod = CURLOPT_CUSTOMREQUEST;
$curlMethodValue = "HEAD";
break;
default:
throw new \RuntimeException('Method '. strtoupper($method) .' is not supported');
}

return array($curlMethod, $curlMethodValue);
}
}

0 comments on commit c77cf9a

Please sign in to comment.