[PSR] Fixed library source

- Using `php-cs-fixer` tool.
This commit is contained in:
Jay Patel
2016-07-14 13:06:24 -05:00
parent a46855bfef
commit 1401d5563d
24 changed files with 41 additions and 55 deletions

View File

@@ -95,7 +95,6 @@ class PayPalConfigManager
*/
public function get($searchKey)
{
if (array_key_exists($searchKey, $this->configs)) {
return $this->configs[$searchKey];
} else {
@@ -108,7 +107,6 @@ class PayPalConfigManager
return $arr;
}
}
/**
@@ -123,7 +121,6 @@ class PayPalConfigManager
*/
public function getIniPrefix($userId = null)
{
if ($userId == null) {
$arr = array();
foreach ($this->configs as $key => $value) {
@@ -157,7 +154,4 @@ class PayPalConfigManager
{
trigger_error('Clone is not allowed.', E_USER_ERROR);
}
}

View File

@@ -113,7 +113,6 @@ class PayPalCredentialManager
$suffix++;
$key = $prefix . $suffix;
}
}
/**
@@ -146,7 +145,7 @@ class PayPalCredentialManager
{
if ($userId == null && array_key_exists($this->defaultAccountName, $this->credentialHashmap)) {
$credObj = $this->credentialHashmap[$this->defaultAccountName];
} else if (array_key_exists($userId, $this->credentialHashmap)) {
} elseif (array_key_exists($userId, $this->credentialHashmap)) {
$credObj = $this->credentialHashmap[$userId];
}
@@ -164,5 +163,4 @@ class PayPalCredentialManager
{
trigger_error('Clone is not allowed.', E_USER_ERROR);
}
}

View File

@@ -21,7 +21,7 @@ class PayPalHttpConfig
public static $defaultCurlOptions = array(
CURLOPT_SSLVERSION => 6,
CURLOPT_CONNECTTIMEOUT => 10,
CURLOPT_RETURNTRANSFER => TRUE,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 60, // maximum number of seconds to allow cURL functions to execute
CURLOPT_USERAGENT => 'PayPal-PHP-SDK',
CURLOPT_HTTPHEADER => array(),

View File

@@ -55,7 +55,6 @@ class PayPalHttpConnection
*/
private function getHttpHeaders()
{
$ret = array();
foreach ($this->httpConfig->getHeaders() as $k => $v) {
$ret[] = "$k: $v";
@@ -78,8 +77,8 @@ class PayPalHttpConnection
//Initialize Curl Options
$ch = curl_init($this->httpConfig->getUrl());
$options = $this->httpConfig->getCurlOptions();
if(empty($options[CURLOPT_HTTPHEADER])) {
unset ($options[CURLOPT_HTTPHEADER]);
if (empty($options[CURLOPT_HTTPHEADER])) {
unset($options[CURLOPT_HTTPHEADER]);
}
curl_setopt_array($ch, $options);
curl_setopt($ch, CURLOPT_URL, $this->httpConfig->getUrl());
@@ -101,7 +100,7 @@ class PayPalHttpConnection
}
//Default Option if Method not of given types in switch case
if ($this->httpConfig->getMethod() != NULL) {
if ($this->httpConfig->getMethod() != null) {
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $this->httpConfig->getMethod());
}
@@ -174,14 +173,14 @@ class PayPalHttpConnection
"Retried $retries times." . $result);
$this->logger->debug("\n\n" . str_repeat('=', 128) . "\n");
throw $ex;
} else if ($httpStatus < 200 || $httpStatus >= 300) {
} elseif ($httpStatus < 200 || $httpStatus >= 300) {
$ex = new PayPalConnectionException(
$this->httpConfig->getUrl(),
"Got Http response code $httpStatus when accessing {$this->httpConfig->getUrl()}.",
$httpStatus
);
$ex->setData($result);
$this->logger->error("Got Http response code $httpStatus when accessing {$this->httpConfig->getUrl()}. " . $result );
$this->logger->error("Got Http response code $httpStatus when accessing {$this->httpConfig->getUrl()}. " . $result);
$this->logger->debug("\n\n" . str_repeat('=', 128) . "\n");
throw $ex;
}
@@ -191,5 +190,4 @@ class PayPalHttpConnection
//Return result object
return $result;
}
}

View File

@@ -116,5 +116,4 @@ class PayPalLoggingManager
$this->logger->debug($message);
}
}
}