Skip to content
This repository has been archived by the owner on Nov 8, 2022. It is now read-only.

Commit

Permalink
php-cs-fixer
Browse files Browse the repository at this point in the history
  • Loading branch information
harto committed Nov 20, 2015
1 parent 9ea3b5f commit 9dc71c8
Showing 1 changed file with 60 additions and 58 deletions.
118 changes: 60 additions & 58 deletions classes/RightSignature/HttpClient.php
Expand Up @@ -45,65 +45,67 @@ private function __construct(ClientInterface $client)
/**
* @param $bool
*/
public function setVerifySSL($bool) {
$this->_verifySSL = (bool) $bool;
}

/**
* @param string $path
* @return string
* @throws Exception
*/
public function get($path)
{
$getRequest = [
$path, [
'headers' => $this->_getHeaders(),
'verify' => $this->_verifySSL
]
];

return $this->_submit('get', $getRequest);
}

/**
* @param string $path
* @param string $body
* @return string
* @throws Exception
*/
public function post($path, $body=null)
{
$postRequest = [
$path, [
'headers' => $this->_getHeaders(),
'verify' => $this->_verifySSL
]
];

if (is_array($body))
{
$postRequest['form_params'] = $body;
}
else
{
$postRequest['body'] = $body;
}

return $this->_submit('post', $postRequest);
}

/**
* @return array headers for client call
public function setVerifySSL($bool)
{
$this->_verifySSL = (bool) $bool;
}

/**
* @param string $path
*
* @return string
*
* @throws Exception
*/
public function get($path)
{
$getRequest = [
$path, [
'headers' => $this->_getHeaders(),
'verify' => $this->_verifySSL,
],
];

return $this->_submit('get', $getRequest);
}

/**
* @param string $path
* @param string $body
*
* @return string
*
* @throws Exception
*/
public function post($path, $body = null)
{
$postRequest = [
$path, [
'headers' => $this->_getHeaders(),
'verify' => $this->_verifySSL,
],
];

if (is_array($body)) {
$postRequest['form_params'] = $body;
} else {
$postRequest['body'] = $body;
}

return $this->_submit('post', $postRequest);
}

/**
* @return array headers for client call
*/
private function _getHeaders()
{
return [
'Api-Token' => $this->_apiToken,
'Api-Version' => \RightSignature::API_VERSION,
'Content-Type' => 'application/xml'
];
}
private function _getHeaders()
{
return [
'Api-Token' => $this->_apiToken,
'Api-Version' => \RightSignature::API_VERSION,
'Content-Type' => 'application/xml',
];
}

/**
* @param $method
Expand Down

0 comments on commit 9dc71c8

Please sign in to comment.