Completed
Push — master ( a8539b...a6b778 )
by Hector
24s
created
src/TwitterAds.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
         $this->response->setApiPath($path);
226 226
         $url = sprintf('%s/%s', self::API_HOST_OAUTH, $path);
227 227
         $request = Request::fromConsumerAndToken($this->consumer, $this->token, $method, $url, $parameters);
228
-        $authorization = 'Authorization: Basic ' . $this->encodeAppAuthorization($this->consumer);
228
+        $authorization = 'Authorization: Basic '.$this->encodeAppAuthorization($this->consumer);
229 229
         $result = $this->request($request->getNormalizedHttpUrl(), $method, $authorization, $parameters);
230 230
         $response = JsonDecoder::decode($result, $this->decodeJsonAsArray);
231 231
         $this->response->setBody($response);
@@ -461,9 +461,9 @@  discard block
 block discarded – undo
461 461
     public function manageErrors($response)
462 462
     {
463 463
         $errors = [];
464
-        if(isset($response->errors)){
464
+        if (isset($response->errors)) {
465 465
             $errors = $response->errors;
466
-        } else if(isset($response->operation_errors)){
466
+        } else if (isset($response->operation_errors)) {
467 467
             $errors = $response->operation_errors;
468 468
         }
469 469
 
@@ -509,7 +509,7 @@  discard block
 block discarded – undo
509 509
             $request->signRequest($this->signatureMethod, $this->consumer, $this->token);
510 510
             $authorization = $request->toHeader();
511 511
         } else {
512
-            $authorization = 'Authorization: Bearer ' . $this->bearer;
512
+            $authorization = 'Authorization: Bearer '.$this->bearer;
513 513
         }
514 514
         if (strpos($url, TONUpload::DEFAULT_DOMAIN) === 0) {
515 515
             return $this->request($url, $method, $authorization, $parameters, $headers);
@@ -535,7 +535,7 @@  discard block
 block discarded – undo
535 535
         /* Curl settings */
536 536
         $options = [
537 537
             CURLOPT_VERBOSE => false,
538
-            CURLOPT_CAINFO => __DIR__ . DIRECTORY_SEPARATOR . 'cacert.pem',
538
+            CURLOPT_CAINFO => __DIR__.DIRECTORY_SEPARATOR.'cacert.pem',
539 539
             CURLOPT_CONNECTTIMEOUT => $this->connectionTimeout,
540 540
             CURLOPT_HEADER => true,
541 541
             CURLOPT_HTTPHEADER => array_merge(['Accept: */*', $authorization, 'Expect:'], $headers, ['Connection: close']),
@@ -582,7 +582,7 @@  discard block
 block discarded – undo
582 582
         }
583 583
 
584 584
         if (in_array($method, ['GET', 'PUT', 'DELETE']) && !empty($postfields) && !isset($postfields['raw'])) {
585
-            $options[CURLOPT_URL] .= '?' . Util::buildHttpQuery($postfields);
585
+            $options[CURLOPT_URL] .= '?'.Util::buildHttpQuery($postfields);
586 586
         }
587 587
 
588 588
         $curlHandle = curl_init();
@@ -658,7 +658,7 @@  discard block
 block discarded – undo
658 658
         $key = $consumer->key;
659 659
         $secret = $consumer->secret;
660 660
 
661
-        return base64_encode($key . ':' . $secret);
661
+        return base64_encode($key.':'.$secret);
662 662
     }
663 663
 
664 664
     /**
@@ -692,7 +692,7 @@  discard block
 block discarded – undo
692 692
      */
693 693
     public function getAccountId()
694 694
     {
695
-        if(!$this->account instanceof Account){
695
+        if (!$this->account instanceof Account) {
696 696
             return '';
697 697
         }
698 698
         return $this->account->getId();
@@ -703,7 +703,7 @@  discard block
 block discarded – undo
703 703
      */
704 704
     public function getAccountTimezone()
705 705
     {
706
-        if(!$this->account instanceof Account){
706
+        if (!$this->account instanceof Account) {
707 707
             return 'UTC';
708 708
         }
709 709
         return $this->account->getTimezone();
@@ -819,9 +819,9 @@  discard block
 block discarded – undo
819 819
             $token = $token['oauth_token'];
820 820
         }
821 821
         if (empty($sign_in_with_twitter)) {
822
-            return $this->authorizeURL() . "?oauth_token={$token}";
822
+            return $this->authorizeURL()."?oauth_token={$token}";
823 823
         } else {
824
-            return $this->authenticateURL() . "?oauth_token={$token}";
824
+            return $this->authenticateURL()."?oauth_token={$token}";
825 825
         }
826 826
     }
827 827
 }
Please login to merge, or discard this patch.