Completed
Push — master ( 179c68...7ebb95 )
by Hector
03:48
created
src/TwitterAds.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -367,10 +367,10 @@  discard block
 block discarded – undo
367 367
         $this->method = $method;
368 368
         $this->resource = $path;
369 369
         $this->resetLastResponse();
370
-        if(strpos($path, TONUpload::DEFAULT_DOMAIN) === 0) {
370
+        if (strpos($path, TONUpload::DEFAULT_DOMAIN) === 0) {
371 371
             $url = $path;
372 372
         } else {
373
-            if($host == self::UPLOAD_HOST){
373
+            if ($host == self::UPLOAD_HOST) {
374 374
                 $url = sprintf('%s/%s/%s', $host, self::API_REST_VERSION, $path);
375 375
             } else {
376 376
                 $url = sprintf('%s/%s/%s', $host, self::API_VERSION, $path);
@@ -397,7 +397,7 @@  discard block
 block discarded – undo
397 397
      * @throws ServerError
398 398
      * @throws ServiceUnavailable
399 399
      */
400
-    public function manageErrors($response){
400
+    public function manageErrors($response) {
401 401
         switch ($this->getLastHttpCode()) {
402 402
             case 400:
403 403
                 throw new BadRequest(TwitterAdsException::BAD_REQUEST, 400, null, $response->errors);
@@ -443,7 +443,7 @@  discard block
 block discarded – undo
443 443
         } else {
444 444
             $authorization = 'Authorization: Bearer '.$this->bearer;
445 445
         }
446
-        if(strpos($url, TONUpload::DEFAULT_DOMAIN) === 0) {
446
+        if (strpos($url, TONUpload::DEFAULT_DOMAIN) === 0) {
447 447
             return $this->request($url, $method, $authorization, $parameters, $headers);
448 448
         } else {
449 449
             return $this->request($request->getNormalizedHttpUrl(), $method, $authorization, $parameters, $headers);
@@ -471,7 +471,7 @@  discard block
 block discarded – undo
471 471
             CURLOPT_CAINFO => __DIR__.DIRECTORY_SEPARATOR.'cacert.pem',
472 472
             CURLOPT_CONNECTTIMEOUT => $this->connectionTimeout,
473 473
             CURLOPT_HEADER => true,
474
-            CURLOPT_HTTPHEADER => array_merge(['Accept: */*', $authorization, 'Expect:'],$headers,['Connection: close']),
474
+            CURLOPT_HTTPHEADER => array_merge(['Accept: */*', $authorization, 'Expect:'], $headers, ['Connection: close']),
475 475
             CURLOPT_RETURNTRANSFER => true,
476 476
             CURLOPT_SSL_VERIFYHOST => 2,
477 477
             CURLOPT_SSL_VERIFYPEER => true,
@@ -494,7 +494,7 @@  discard block
 block discarded – undo
494 494
                 break;
495 495
             case 'POST':
496 496
                 $options[CURLOPT_POST] = true;
497
-                if(isset($postfields['raw'])){
497
+                if (isset($postfields['raw'])) {
498 498
                     $options[CURLOPT_POSTFIELDS] = $postfields['raw'];
499 499
                 } else {
500 500
                     $options[CURLOPT_POSTFIELDS] = Util::buildHttpQuery($postfields);
@@ -506,7 +506,7 @@  discard block
 block discarded – undo
506 506
                 break;
507 507
             case 'PUT':
508 508
                 $options[CURLOPT_CUSTOMREQUEST] = 'PUT';
509
-                if(isset($postfields['raw'])){
509
+                if (isset($postfields['raw'])) {
510 510
                     $options[CURLOPT_POSTFIELDS] = $postfields['raw'];
511 511
                 }
512 512
                 break;
Please login to merge, or discard this patch.
examples/promoted_tweet.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@
 block discarded – undo
46 46
 
47 47
 // create request for a simple nullcasted tweet
48 48
 $media = $twitterAds->upload(['media'=> 'kitten.jpg']);
49
-$tweet1 = Tweet::create($account, 'Tweet number 1 ...'.rand().' http://twitter.com',['media_ids'=> $media->media_id]);
49
+$tweet1 = Tweet::create($account, 'Tweet number 1 ...'.rand().' http://twitter.com', ['media_ids'=> $media->media_id]);
50 50
 
51 51
 // promote the tweet using our line item
52 52
 $promotedTweet = new PromotedTweet($account);
Please login to merge, or discard this patch.