Completed
Push — master ( 7ebb95...8f8be8 )
by Hector
02:52
created
src/TwitterAds.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -307,7 +307,7 @@  discard block
 block discarded – undo
307 307
     {
308 308
         if ($parameters['media_type'] == 'video/mp4') {
309 309
             $parameters['media_category'] = "amplify_video";
310
-        } elseif($parameters['media_type'] == 'image/gif'){
310
+        } elseif ($parameters['media_type'] == 'image/gif') {
311 311
             $parameters['media_category'] = 'tweet_gif';
312 312
         }
313 313
 
@@ -390,10 +390,10 @@  discard block
 block discarded – undo
390 390
         $this->method = $method;
391 391
         $this->resource = $path;
392 392
         $this->resetLastResponse();
393
-        if(strpos($path, TONUpload::DEFAULT_DOMAIN) === 0) {
393
+        if (strpos($path, TONUpload::DEFAULT_DOMAIN) === 0) {
394 394
             $url = $path;
395 395
         } else {
396
-            if($host == self::UPLOAD_HOST){
396
+            if ($host == self::UPLOAD_HOST) {
397 397
                 $url = sprintf('%s/%s/%s', $host, self::API_REST_VERSION, $path);
398 398
             } else {
399 399
                 $url = sprintf('%s/%s/%s', $host, self::API_VERSION, $path);
@@ -420,7 +420,7 @@  discard block
 block discarded – undo
420 420
      * @throws ServerError
421 421
      * @throws ServiceUnavailable
422 422
      */
423
-    public function manageErrors($response){
423
+    public function manageErrors($response) {
424 424
         switch ($this->getLastHttpCode()) {
425 425
             case 400:
426 426
                 throw new BadRequest(TwitterAdsException::BAD_REQUEST, 400, null, $response->errors);
@@ -466,7 +466,7 @@  discard block
 block discarded – undo
466 466
         } else {
467 467
             $authorization = 'Authorization: Bearer '.$this->bearer;
468 468
         }
469
-        if(strpos($url, TONUpload::DEFAULT_DOMAIN) === 0) {
469
+        if (strpos($url, TONUpload::DEFAULT_DOMAIN) === 0) {
470 470
             return $this->request($url, $method, $authorization, $parameters, $headers);
471 471
         } else {
472 472
             return $this->request($request->getNormalizedHttpUrl(), $method, $authorization, $parameters, $headers);
@@ -494,7 +494,7 @@  discard block
 block discarded – undo
494 494
             CURLOPT_CAINFO => __DIR__.DIRECTORY_SEPARATOR.'cacert.pem',
495 495
             CURLOPT_CONNECTTIMEOUT => $this->connectionTimeout,
496 496
             CURLOPT_HEADER => true,
497
-            CURLOPT_HTTPHEADER => array_merge(['Accept: */*', $authorization, 'Expect:'],$headers,['Connection: close']),
497
+            CURLOPT_HTTPHEADER => array_merge(['Accept: */*', $authorization, 'Expect:'], $headers, ['Connection: close']),
498 498
             CURLOPT_RETURNTRANSFER => true,
499 499
             CURLOPT_SSL_VERIFYHOST => 2,
500 500
             CURLOPT_SSL_VERIFYPEER => true,
@@ -517,7 +517,7 @@  discard block
 block discarded – undo
517 517
                 break;
518 518
             case 'POST':
519 519
                 $options[CURLOPT_POST] = true;
520
-                if(isset($postfields['raw'])){
520
+                if (isset($postfields['raw'])) {
521 521
                     $options[CURLOPT_POSTFIELDS] = $postfields['raw'];
522 522
                 } else {
523 523
                     $options[CURLOPT_POSTFIELDS] = Util::buildHttpQuery($postfields);
@@ -529,7 +529,7 @@  discard block
 block discarded – undo
529 529
                 break;
530 530
             case 'PUT':
531 531
                 $options[CURLOPT_CUSTOMREQUEST] = 'PUT';
532
-                if(isset($postfields['raw'])){
532
+                if (isset($postfields['raw'])) {
533 533
                     $options[CURLOPT_POSTFIELDS] = $postfields['raw'];
534 534
                 }
535 535
                 break;
Please login to merge, or discard this patch.
examples/chunked_upload.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,4 +26,4 @@
 block discarded – undo
26 26
 
27 27
 // create request for a simple nullcasted tweet
28 28
 $media = $twitterAds->upload(['media'=> 'twitter-gif.gif', 'media_type' => 'image/gif'], true);
29
-$tweet = Tweet::create($account, 'Tweet with chunked upload GIF...'.rand().' http://twitter.com',['media_ids'=> $media->media_id]);
30 29
\ No newline at end of file
30
+$tweet = Tweet::create($account, 'Tweet with chunked upload GIF...'.rand().' http://twitter.com', ['media_ids'=> $media->media_id]);
31 31
\ No newline at end of file
Please login to merge, or discard this patch.