@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | const HTTP_METHOD_PUT = 'PUT'; |
| 35 | 35 | const HTTP_METHOD_DELETE = 'DELETE'; |
| 36 | 36 | const HTTP_METHOD_HEAD = 'HEAD'; |
| 37 | - const HTTP_METHOD_PATCH = 'PATCH'; |
|
| 37 | + const HTTP_METHOD_PATCH = 'PATCH'; |
|
| 38 | 38 | |
| 39 | 39 | /** |
| 40 | 40 | * HTTP Form content types |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | $this->client_secret = $client_secret; |
| 139 | 139 | $this->client_auth = $client_auth; |
| 140 | 140 | $this->certificate_file = $certificate_file; |
| 141 | - if (!empty($this->certificate_file) && !is_file($this->certificate_file)) { |
|
| 141 | + if (!empty($this->certificate_file) && !is_file($this->certificate_file)) { |
|
| 142 | 142 | throw new InvalidArgumentException('The certificate file was not found', InvalidArgumentException::CERTIFICATE_NOT_FOUND); |
| 143 | 143 | } |
| 144 | 144 | } |
@@ -197,7 +197,7 @@ discard block |
||
| 197 | 197 | throw new InvalidArgumentException('The grant_type is mandatory.', InvalidArgumentException::INVALID_GRANT_TYPE); |
| 198 | 198 | } |
| 199 | 199 | $grantTypeClassName = $this->convertToCamelCase($grant_type); |
| 200 | - $grantTypeClass = __NAMESPACE__ . '\\GrantType\\' . $grantTypeClassName; |
|
| 200 | + $grantTypeClass = __NAMESPACE__ . '\\GrantType\\' . $grantTypeClassName; |
|
| 201 | 201 | if (!class_exists($grantTypeClass)) { |
| 202 | 202 | throw new InvalidArgumentException('Unknown grant type \'' . $grant_type . '\'', InvalidArgumentException::INVALID_GRANT_TYPE); |
| 203 | 203 | } |
@@ -216,7 +216,7 @@ discard block |
||
| 216 | 216 | break; |
| 217 | 217 | case self::AUTH_TYPE_AUTHORIZATION_BASIC: |
| 218 | 218 | $parameters['client_id'] = $this->client_id; |
| 219 | - $http_headers['Authorization'] = 'Basic ' . base64_encode($this->client_id . ':' . $this->client_secret); |
|
| 219 | + $http_headers['Authorization'] = 'Basic ' . base64_encode($this->client_id . ':' . $this->client_secret); |
|
| 220 | 220 | break; |
| 221 | 221 | default: |
| 222 | 222 | throw new Exception('Unknown client auth type.', Exception::INVALID_CLIENT_AUTHENTICATION_TYPE); |
@@ -392,7 +392,7 @@ discard block |
||
| 392 | 392 | CURLOPT_CUSTOMREQUEST => $http_method |
| 393 | 393 | ); |
| 394 | 394 | |
| 395 | - switch($http_method) { |
|
| 395 | + switch ($http_method) { |
|
| 396 | 396 | case self::HTTP_METHOD_POST: |
| 397 | 397 | $curl_options[CURLOPT_POST] = true; |
| 398 | 398 | /* No break */ |
@@ -404,7 +404,7 @@ discard block |
||
| 404 | 404 | * while passing a URL-encoded string will encode the data as application/x-www-form-urlencoded. |
| 405 | 405 | * http://php.net/manual/en/function.curl-setopt.php |
| 406 | 406 | */ |
| 407 | - if(is_array($parameters) && self::HTTP_FORM_CONTENT_TYPE_APPLICATION === $form_content_type) { |
|
| 407 | + if (is_array($parameters) && self::HTTP_FORM_CONTENT_TYPE_APPLICATION === $form_content_type) { |
|
| 408 | 408 | $parameters = http_build_query($parameters, null, '&'); |
| 409 | 409 | } |
| 410 | 410 | $curl_options[CURLOPT_POSTFIELDS] = $parameters; |
@@ -428,7 +428,7 @@ discard block |
||
| 428 | 428 | |
| 429 | 429 | if (is_array($http_headers)) { |
| 430 | 430 | $header = array(); |
| 431 | - foreach($http_headers as $key => $parsed_urlvalue) { |
|
| 431 | + foreach ($http_headers as $key => $parsed_urlvalue) { |
|
| 432 | 432 | $header[] = "$key: $parsed_urlvalue"; |
| 433 | 433 | } |
| 434 | 434 | $curl_options[CURLOPT_HTTPHEADER] = $header; |
@@ -486,7 +486,7 @@ discard block |
||
| 486 | 486 | private function convertToCamelCase($grant_type) |
| 487 | 487 | { |
| 488 | 488 | $parts = explode('_', $grant_type); |
| 489 | - array_walk($parts, function (&$item) { |
|
| 489 | + array_walk($parts, function(&$item) { |
|
| 490 | 490 | $item = ucfirst($item); |
| 491 | 491 | }); |
| 492 | 492 | return implode('', $parts); |