@@ -235,7 +235,7 @@ discard block |
||
235 | 235 | $this->response->setApiPath($path); |
236 | 236 | $url = sprintf('%s/%s', self::API_HOST_OAUTH, $path); |
237 | 237 | $request = Request::fromConsumerAndToken($this->consumer, $this->token, $method, $url, $parameters); |
238 | - $authorization = 'Authorization: Basic ' . $this->encodeAppAuthorization($this->consumer); |
|
238 | + $authorization = 'Authorization: Basic '.$this->encodeAppAuthorization($this->consumer); |
|
239 | 239 | $result = $this->request($request->getNormalizedHttpUrl(), $method, $authorization, $parameters); |
240 | 240 | $response = JsonDecoder::decode($result, $this->decodeJsonAsArray); |
241 | 241 | $this->response->setBody($response); |
@@ -525,9 +525,9 @@ discard block |
||
525 | 525 | public function manageErrors($response) |
526 | 526 | { |
527 | 527 | $errors = []; |
528 | - if(isset($response->errors)){ |
|
528 | + if (isset($response->errors)) { |
|
529 | 529 | $errors = $response->errors; |
530 | - } else if(isset($response->operation_errors)){ |
|
530 | + } else if (isset($response->operation_errors)) { |
|
531 | 531 | $errors = $response->operation_errors; |
532 | 532 | } |
533 | 533 | |
@@ -573,7 +573,7 @@ discard block |
||
573 | 573 | $request->signRequest($this->signatureMethod, $this->consumer, $this->token); |
574 | 574 | $authorization = $request->toHeader(); |
575 | 575 | } else { |
576 | - $authorization = 'Authorization: Bearer ' . $this->bearer; |
|
576 | + $authorization = 'Authorization: Bearer '.$this->bearer; |
|
577 | 577 | } |
578 | 578 | if (strpos($url, TONUpload::DEFAULT_DOMAIN) === 0) { |
579 | 579 | return $this->request($url, $method, $authorization, $parameters, $headers); |
@@ -599,7 +599,7 @@ discard block |
||
599 | 599 | /* Curl settings */ |
600 | 600 | $options = [ |
601 | 601 | CURLOPT_VERBOSE => false, |
602 | - CURLOPT_CAINFO => __DIR__ . DIRECTORY_SEPARATOR . 'cacert.pem', |
|
602 | + CURLOPT_CAINFO => __DIR__.DIRECTORY_SEPARATOR.'cacert.pem', |
|
603 | 603 | CURLOPT_CONNECTTIMEOUT => $this->connectionTimeout, |
604 | 604 | CURLOPT_HEADER => true, |
605 | 605 | CURLOPT_HTTPHEADER => array_merge(['Accept: */*', $authorization, 'Expect:'], $headers, ['Connection: close']), |
@@ -629,7 +629,7 @@ discard block |
||
629 | 629 | $options[CURLOPT_POSTFIELDS] = $postfields['raw']; |
630 | 630 | $options[CURLOPT_HTTPHEADER] = array_merge($options[CURLOPT_HTTPHEADER], [ |
631 | 631 | 'Content-Type: application/json', |
632 | - 'Content-Length: '. strlen($postfields['raw']) |
|
632 | + 'Content-Length: '.strlen($postfields['raw']) |
|
633 | 633 | ]); |
634 | 634 | } else { |
635 | 635 | $options[CURLOPT_POSTFIELDS] = Util::buildHttpQuery($postfields); |
@@ -648,7 +648,7 @@ discard block |
||
648 | 648 | } |
649 | 649 | |
650 | 650 | if (in_array($method, ['GET', 'PUT', 'DELETE']) && !empty($postfields) && !isset($postfields['raw'])) { |
651 | - $options[CURLOPT_URL] .= '?' . Util::buildHttpQuery($postfields); |
|
651 | + $options[CURLOPT_URL] .= '?'.Util::buildHttpQuery($postfields); |
|
652 | 652 | } |
653 | 653 | |
654 | 654 | $curlHandle = curl_init(); |
@@ -724,7 +724,7 @@ discard block |
||
724 | 724 | $key = $consumer->key; |
725 | 725 | $secret = $consumer->secret; |
726 | 726 | |
727 | - return base64_encode($key . ':' . $secret); |
|
727 | + return base64_encode($key.':'.$secret); |
|
728 | 728 | } |
729 | 729 | |
730 | 730 | /** |
@@ -758,7 +758,7 @@ discard block |
||
758 | 758 | */ |
759 | 759 | public function getAccountId() |
760 | 760 | { |
761 | - if(!$this->account instanceof Account){ |
|
761 | + if (!$this->account instanceof Account) { |
|
762 | 762 | return ''; |
763 | 763 | } |
764 | 764 | return $this->account->getId(); |
@@ -769,7 +769,7 @@ discard block |
||
769 | 769 | */ |
770 | 770 | public function getAccountTimezone() |
771 | 771 | { |
772 | - if(!$this->account instanceof Account){ |
|
772 | + if (!$this->account instanceof Account) { |
|
773 | 773 | return 'UTC'; |
774 | 774 | } |
775 | 775 | return $this->account->getTimezone(); |
@@ -884,9 +884,9 @@ discard block |
||
884 | 884 | $token = $token['oauth_token']; |
885 | 885 | } |
886 | 886 | if (empty($sign_in_with_twitter)) { |
887 | - return $this->authorizeURL() . "?oauth_token={$token}"; |
|
887 | + return $this->authorizeURL()."?oauth_token={$token}"; |
|
888 | 888 | } |
889 | 889 | |
890 | - return $this->authenticateURL() . "?oauth_token={$token}"; |
|
890 | + return $this->authenticateURL()."?oauth_token={$token}"; |
|
891 | 891 | } |
892 | 892 | } |