Passed
Branch master (9792f7)
by Rakesh
01:59
created
lib/Facebook/FacebookApp.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@
 block discarded – undo
47 47
     public function __construct($id, $secret)
48 48
     {
49 49
         if (!is_string($id)
50
-          // Keeping this for BC. Integers greater than PHP_INT_MAX will make is_int() return false
50
+            // Keeping this for BC. Integers greater than PHP_INT_MAX will make is_int() return false
51 51
           && !is_int($id)) {
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
         }
Please login to merge, or discard this patch.
lib/Facebook/Facebook.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -602,8 +602,8 @@
 block discarded – undo
602 602
         } while (!$chunk->isLastChunk());
603 603
 
604 604
         return [
605
-          'video_id' => $chunk->getVideoId(),
606
-          'success' => $uploader->finish($endpoint, $chunk->getUploadSessionId(), $metadata),
605
+            'video_id' => $chunk->getVideoId(),
606
+            'success' => $uploader->finish($endpoint, $chunk->getUploadSessionId(), $metadata),
607 607
         ];
608 608
     }
609 609
 
Please login to merge, or discard this patch.
index.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -6,10 +6,10 @@
 block discarded – undo
6 6
 }
7 7
 
8 8
 $fb = new Facebook\Facebook([
9
-  'app_id' => '362540437809242', // my facebook app id
10
-  'app_secret' => '538cd04f971479ff14dc409df2fbcf3b',
11
-  'default_graph_version' => 'v3.2',
12
-  ]);
9
+    'app_id' => '362540437809242', // my facebook app id
10
+    'app_secret' => '538cd04f971479ff14dc409df2fbcf3b',
11
+    'default_graph_version' => 'v3.2',
12
+    ]);
13 13
 
14 14
 $helper = $fb->getRedirectLoginHelper();
15 15
 
Please login to merge, or discard this patch.
fb-callback.php 1 patch
Indentation   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -1,41 +1,41 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 require_once 'lib\Facebook\autoload.php';
3 3
 if(!session_id()) {
4
-  session_start();
4
+    session_start();
5 5
 }
6 6
 
7 7
 $fb = new Facebook\Facebook([
8
-  'app_id' => '362540437809242', // My Facebook App ID
9
-  'app_secret' => '538cd04f971479ff14dc409df2fbcf3b',
10
-  'default_graph_version' => 'v3.2',
11
-  ]);
8
+    'app_id' => '362540437809242', // My Facebook App ID
9
+    'app_secret' => '538cd04f971479ff14dc409df2fbcf3b',
10
+    'default_graph_version' => 'v3.2',
11
+    ]);
12 12
 
13 13
 $helper = $fb->getRedirectLoginHelper();
14 14
 
15 15
 try {
16
-  $accessToken = $helper->getAccessToken();
16
+    $accessToken = $helper->getAccessToken();
17 17
 } catch(Facebook\Exceptions\FacebookResponseException $e) {
18
-  // When Graph returns an error
19
-  echo 'Graph returned an error: ' . $e->getMessage();
20
-  exit;
18
+    // When Graph returns an error
19
+    echo 'Graph returned an error: ' . $e->getMessage();
20
+    exit;
21 21
 } catch(Facebook\Exceptions\FacebookSDKException $e) {
22
-  // When validation fails or other local issues
23
-  echo 'Facebook SDK returned an error: ' . $e->getMessage();
24
-  exit;
22
+    // When validation fails or other local issues
23
+    echo 'Facebook SDK returned an error: ' . $e->getMessage();
24
+    exit;
25 25
 }
26 26
 
27 27
 if (! isset($accessToken)) {
28
-  if ($helper->getError()) {
28
+    if ($helper->getError()) {
29 29
     header('HTTP/1.0 401 Unauthorized');
30 30
     echo "Error: " . $helper->getError() . "\n";
31 31
     echo "Error Code: " . $helper->getErrorCode() . "\n";
32 32
     echo "Error Reason: " . $helper->getErrorReason() . "\n";
33 33
     echo "Error Description: " . $helper->getErrorDescription() . "\n";
34
-  } else {
34
+    } else {
35 35
     header('HTTP/1.0 400 Bad Request');
36 36
     echo 'Bad request';
37
-  }
38
-  exit;
37
+    }
38
+    exit;
39 39
 }
40 40
 
41 41
 // Logged in
@@ -57,29 +57,29 @@  discard block
 block discarded – undo
57 57
 $tokenMetadata->validateExpiration();
58 58
 
59 59
 if (! $accessToken->isLongLived()) {
60
-  // Exchanges a short-lived access token for a long-lived one
61
-  try {
60
+    // Exchanges a short-lived access token for a long-lived one
61
+    try {
62 62
     $accessToken = $oAuth2Client->getLongLivedAccessToken($accessToken);
63
-  } catch (Facebook\Exceptions\FacebookSDKException $e) {
63
+    } catch (Facebook\Exceptions\FacebookSDKException $e) {
64 64
     echo "<p>Error getting long-lived access token: " . $e->getMessage() . "</p>\n\n";
65 65
     exit;
66
-  }
66
+    }
67 67
 
68
-  echo '<h3>Long-lived</h3>';
69
-  var_dump($accessToken->getValue());
68
+    echo '<h3>Long-lived</h3>';
69
+    var_dump($accessToken->getValue());
70 70
 }
71 71
 
72 72
 $_SESSION['fb_access_token'] = (string) $accessToken;
73 73
 
74 74
 try {
75
-  // Returns a `Facebook\FacebookResponse` object
76
-  $response = $fb->get('/me?fields=id,name,link,birthday,location,hometown', $accessToken);
75
+    // Returns a `Facebook\FacebookResponse` object
76
+    $response = $fb->get('/me?fields=id,name,link,birthday,location,hometown', $accessToken);
77 77
 } catch(Facebook\Exceptions\FacebookResponseException $e) {
78
-  echo 'Graph returned an error: ' . $e->getMessage();
79
-  exit;
78
+    echo 'Graph returned an error: ' . $e->getMessage();
79
+    exit;
80 80
 } catch(Facebook\Exceptions\FacebookSDKException $e) {
81
-  echo 'Facebook SDK returned an error: ' . $e->getMessage();
82
-  exit;
81
+    echo 'Facebook SDK returned an error: ' . $e->getMessage();
82
+    exit;
83 83
 }
84 84
 
85 85
 $user = $response->getGraphUser();
Please login to merge, or discard this patch.