Passed
Branch master (9792f7)
by Rakesh
01:59
created
lib/Facebook/Exceptions/FacebookResponseException.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -97,10 +97,10 @@
 block discarded – undo
97 97
                 case 1363037:
98 98
                     $previousException = new FacebookResumableUploadException($message, $code);
99 99
 
100
-                    $startOffset = isset($data['error']['error_data']['start_offset']) ? (int) $data['error']['error_data']['start_offset'] : null;
100
+                    $startOffset = isset($data['error']['error_data']['start_offset']) ? (int)$data['error']['error_data']['start_offset'] : null;
101 101
                     $previousException->setStartOffset($startOffset);
102 102
 
103
-                    $endOffset = isset($data['error']['error_data']['end_offset']) ? (int) $data['error']['error_data']['end_offset'] : null;
103
+                    $endOffset = isset($data['error']['error_data']['end_offset']) ? (int)$data['error']['error_data']['end_offset'] : null;
104 104
                     $previousException->setEndOffset($endOffset);
105 105
 
106 106
                     return new static($response, $previousException);
Please login to merge, or discard this patch.
lib/Facebook/FacebookApp.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@
 block discarded – undo
52 52
             throw new FacebookSDKException('The "app_id" must be formatted as a string since many app ID\'s are greater than PHP_INT_MAX on some systems.');
53 53
         }
54 54
         // We cast as a string in case a valid int was set on a 64-bit system and this is unserialised on a 32-bit system
55
-        $this->id = (string) $id;
55
+        $this->id = (string)$id;
56 56
         $this->secret = $secret;
57 57
     }
58 58
 
Please login to merge, or discard this patch.
lib/Facebook/Facebook.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -593,7 +593,7 @@
 block discarded – undo
593 593
         $graphVersion = $graphVersion ?: $this->defaultGraphVersion;
594 594
 
595 595
         $uploader = new FacebookResumableUploader($this->app, $this->client, $accessToken, $graphVersion);
596
-        $endpoint = '/'.$target.'/videos';
596
+        $endpoint = '/' . $target . '/videos';
597 597
         $file = $this->videoToUpload($pathToFile);
598 598
         $chunk = $uploader->start($endpoint, $file);
599 599
 
Please login to merge, or discard this patch.
lib/Facebook/autoload.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@
 block discarded – undo
44 44
  *
45 45
  * @return void
46 46
  */
47
-spl_autoload_register(function ($class) {
47
+spl_autoload_register(function($class) {
48 48
     // project-specific namespace prefix
49 49
     $prefix = 'Facebook\\';
50 50
 
Please login to merge, or discard this patch.
lib/Facebook/GraphNodes/GraphNode.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -85,7 +85,7 @@
 block discarded – undo
85 85
     {
86 86
         $items = $this->asArray();
87 87
 
88
-        return array_map(function ($v) {
88
+        return array_map(function($v) {
89 89
             if ($v instanceof \DateTime) {
90 90
                 return $v->format(\DateTime::ISO8601);
91 91
             }
Please login to merge, or discard this patch.
lib/Facebook/GraphNodes/Collection.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -128,7 +128,7 @@
 block discarded – undo
128 128
      */
129 129
     public function asArray()
130 130
     {
131
-        return array_map(function ($value) {
131
+        return array_map(function($value) {
132 132
             return $value instanceof Collection ? $value->asArray() : $value;
133 133
         }, $this->items);
134 134
     }
Please login to merge, or discard this patch.
lib/Facebook/Http/GraphRawResponse.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -106,7 +106,7 @@
 block discarded – undo
106 106
     {
107 107
         // https://tools.ietf.org/html/rfc7230#section-3.1.2
108 108
         list($version, $status, $reason) = array_pad(explode(' ', $rawResponseHeader, 3), 3, null);
109
-        $this->httpResponseCode = (int) $status;
109
+        $this->httpResponseCode = (int)$status;
110 110
     }
111 111
 
112 112
     /**
Please login to merge, or discard this patch.
index.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@
 block discarded – undo
1 1
 <?php
2 2
 require_once 'lib\Facebook\autoload.php';
3 3
 
4
-if(!session_id()) {
4
+if (!session_id()) {
5 5
     session_start();
6 6
 }
7 7
 
Please login to merge, or discard this patch.
fb-callback.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 require_once 'lib\Facebook\autoload.php';
3
-if(!session_id()) {
3
+if (!session_id()) {
4 4
   session_start();
5 5
 }
6 6
 
@@ -14,17 +14,17 @@  discard block
 block discarded – undo
14 14
 
15 15
 try {
16 16
   $accessToken = $helper->getAccessToken();
17
-} catch(Facebook\Exceptions\FacebookResponseException $e) {
17
+} catch (Facebook\Exceptions\FacebookResponseException $e) {
18 18
   // When Graph returns an error
19 19
   echo 'Graph returned an error: ' . $e->getMessage();
20 20
   exit;
21
-} catch(Facebook\Exceptions\FacebookSDKException $e) {
21
+} catch (Facebook\Exceptions\FacebookSDKException $e) {
22 22
   // When validation fails or other local issues
23 23
   echo 'Facebook SDK returned an error: ' . $e->getMessage();
24 24
   exit;
25 25
 }
26 26
 
27
-if (! isset($accessToken)) {
27
+if (!isset($accessToken)) {
28 28
   if ($helper->getError()) {
29 29
     header('HTTP/1.0 401 Unauthorized');
30 30
     echo "Error: " . $helper->getError() . "\n";
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
 //$tokenMetadata->validateUserId('123');
57 57
 $tokenMetadata->validateExpiration();
58 58
 
59
-if (! $accessToken->isLongLived()) {
59
+if (!$accessToken->isLongLived()) {
60 60
   // Exchanges a short-lived access token for a long-lived one
61 61
   try {
62 62
     $accessToken = $oAuth2Client->getLongLivedAccessToken($accessToken);
@@ -69,15 +69,15 @@  discard block
 block discarded – undo
69 69
   var_dump($accessToken->getValue());
70 70
 }
71 71
 
72
-$_SESSION['fb_access_token'] = (string) $accessToken;
72
+$_SESSION['fb_access_token'] = (string)$accessToken;
73 73
 
74 74
 try {
75 75
   // Returns a `Facebook\FacebookResponse` object
76 76
   $response = $fb->get('/me?fields=id,name,link,birthday,location,hometown', $accessToken);
77
-} catch(Facebook\Exceptions\FacebookResponseException $e) {
77
+} catch (Facebook\Exceptions\FacebookResponseException $e) {
78 78
   echo 'Graph returned an error: ' . $e->getMessage();
79 79
   exit;
80
-} catch(Facebook\Exceptions\FacebookSDKException $e) {
80
+} catch (Facebook\Exceptions\FacebookSDKException $e) {
81 81
   echo 'Facebook SDK returned an error: ' . $e->getMessage();
82 82
   exit;
83 83
 }
Please login to merge, or discard this patch.