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