Passed
Push — master ( e7dbe4...bfeae7 )
by Rakesh
01:40
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   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,14 +1,14 @@
 block discarded – undo
1 1
 <?php
2 2
 if(!session_id()) {
3
-  session_start();
3
+    session_start();
4 4
 }
5 5
 require_once 'appconfig.php';
6 6
 
7 7
 $fb = new Facebook\Facebook([
8
-  'app_id' => $appId,
9
-  'app_secret' => $appSecret,
10
-  'default_graph_version' => 'v3.2',
11
-  ]);
8
+    'app_id' => $appId,
9
+    'app_secret' => $appSecret,
10
+    'default_graph_version' => 'v3.2',
11
+    ]);
12 12
 
13 13
 $helper = $fb->getRedirectLoginHelper();
14 14
 
Please login to merge, or discard this patch.
member.php 1 patch
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -2,8 +2,8 @@  discard block
 block discarded – undo
2 2
 require_once 'appconfig.php';
3 3
 
4 4
 if(isset($_SESSION['fb_access_token'])){
5
-  // Get access token from session
6
-  $accessToken = (string) $_SESSION['fb_access_token'];
5
+    // Get access token from session
6
+    $accessToken = (string) $_SESSION['fb_access_token'];
7 7
 /* 
8 8
 $fb = new Facebook\Facebook([
9 9
     'app_id' => $appId,
@@ -18,8 +18,8 @@  discard block
 block discarded – undo
18 18
 }*/
19 19
     echo $accessToken;
20 20
   
21
-  echo 'Welcome, ' . $user['name'];
22
-  echo '<a href="logout.php"  >Logout</a>';
21
+    echo 'Welcome, ' . $user['name'];
22
+    echo '<a href="logout.php"  >Logout</a>';
23 23
 
24 24
 // Get photo albums of Facebook page using Facebook Graph API
25 25
 $fields = "id,name,description,link,cover_photo,count";
@@ -57,8 +57,8 @@  discard block
 block discarded – undo
57 57
 }
58 58
 //}
59 59
 if(isset($_GET['album_id']) && isset($_GET['album_id'])){
60
-  $album_id = $_GET['album_id'];
61
-  $album_name = $_GET['album_name']; //isset($_GET['album_name'])?:header('Location: fb-callback.php');
60
+    $album_id = $_GET['album_id'];
61
+    $album_name = $_GET['album_name']; //isset($_GET['album_name'])?:header('Location: fb-callback.php');
62 62
 }
63 63
 
64 64
 
@@ -113,13 +113,13 @@  discard block
 block discarded – undo
113 113
 
114 114
   <div style="text-align:center">
115 115
   <?php
116
-  if (is_array($fbPhotoData) || is_object($fbPhotoData))
117
-  { 
116
+    if (is_array($fbPhotoData) || is_object($fbPhotoData))
117
+    { 
118 118
     foreach($fbPhotoData as $data){
119
-      echo "<span class='dot'></span>";
120
-   }
121
-  }
122
-  ?>
119
+        echo "<span class='dot'></span>";
120
+    }
121
+    }
122
+    ?>
123 123
   </div>
124 124
 
125 125
 </div>
Please login to merge, or discard this patch.
slideshow.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 
12 12
 //if(isset($_SESSION['fb_access_token'])){
13 13
     // Get access token from session
14
-  //  $accessToken = (string) $_SESSION['fb_access_token'];
14
+    //  $accessToken = (string) $_SESSION['fb_access_token'];
15 15
 //}else{
16 16
     $graphActLink = "https://graph.facebook.com/oauth/access_token?client_id={$appId}&client_secret={$appSecret}&grant_type=client_credentials";
17 17
     
@@ -24,8 +24,8 @@  discard block
 block discarded – undo
24 24
     $_SESSION['fb_access_token'] = $accessToken;
25 25
 
26 26
 if(isset($_GET['album_id']) && isset($_GET['album_name'])){
27
-  $album_id = $_GET['album_id'];
28
-  $album_name = $_GET['album_name']; //isset($_GET['album_name'])?:header('Location: fb-callback.php');
27
+    $album_id = $_GET['album_id'];
28
+    $album_name = $_GET['album_name']; //isset($_GET['album_name'])?:header('Location: fb-callback.php');
29 29
 
30 30
 // Get photos of Facebook page album using Facebook Graph API
31 31
 $graphPhoLink = "https://graph.facebook.com/v3.2/{$album_id}/photos?fields=source,images,name&access_token={$accessToken}";
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
 echo '</div> <br />';
54 54
 echo '<div style="text-align:center">';
55 55
 foreach($fbPhotoData as $data){
56
-  echo '<span class="dot"></span>';
56
+    echo '<span class="dot"></span>';
57 57
 }
58 58
 echo '</div>';
59 59
 
Please login to merge, or discard this patch.
fb-callback.php 1 patch
Indentation   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -1,41 +1,41 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 if(!session_id()) {
3
-  session_start();
3
+    session_start();
4 4
 }
5 5
 require_once 'appconfig.php';
6 6
 
7 7
 $fb = new Facebook\Facebook([
8
-  'app_id' => $appId, // variable with My Facebook App ID
9
-  'app_secret' => $appSecret,
10
-  'default_graph_version' => 'v3.2',
11
-  ]);
8
+    'app_id' => $appId, // variable with My Facebook App ID
9
+    'app_secret' => $appSecret,
10
+    'default_graph_version' => 'v3.2',
11
+    ]);
12 12
 $helper = $fb->getRedirectLoginHelper();
13 13
 if(isset($_GET['state'])){
14
-  $helper->getPersistentDataHandler()->set('state',$_GET['state']);
14
+    $helper->getPersistentDataHandler()->set('state',$_GET['state']);
15 15
 }
16 16
 try {
17
-  $accessToken = $helper->getAccessToken();
17
+    $accessToken = $helper->getAccessToken();
18 18
 } catch(Facebook\Exceptions\FacebookResponseException $e) {
19
-  // When Graph returns an error
20
-  echo 'Graph returned an error: ' . $e->getMessage();
21
-  exit;
19
+    // When Graph returns an error
20
+    echo 'Graph returned an error: ' . $e->getMessage();
21
+    exit;
22 22
 } catch(Facebook\Exceptions\FacebookSDKException $e) {
23
-  // When validation fails or other local issues
24
-  echo 'Facebook SDK returned an error: ' . $e->getMessage();
25
-  exit;
23
+    // When validation fails or other local issues
24
+    echo 'Facebook SDK returned an error: ' . $e->getMessage();
25
+    exit;
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
 // Logged in
41 41
 echo '<h3>Access Token</h3>';
@@ -52,27 +52,27 @@  discard block
 block discarded – undo
52 52
 //$tokenMetadata->validateUserId('123');
53 53
 $tokenMetadata->validateExpiration();
54 54
 if (! $accessToken->isLongLived()) {
55
-  // Exchanges a short-lived access token for a long-lived one
56
-  try {
55
+    // Exchanges a short-lived access token for a long-lived one
56
+    try {
57 57
     $accessToken = $oAuth2Client->getLongLivedAccessToken($accessToken);
58
-  } catch (Facebook\Exceptions\FacebookSDKException $e) {
58
+    } catch (Facebook\Exceptions\FacebookSDKException $e) {
59 59
     echo "<p>Error getting long-lived access token: " . $e->getMessage() . "</p>\n\n";
60 60
     exit;
61
-  }
62
-  echo '<h3>Long-lived</h3>';
63
-  var_dump($accessToken->getValue());
61
+    }
62
+    echo '<h3>Long-lived</h3>';
63
+    var_dump($accessToken->getValue());
64 64
 }
65 65
 
66 66
 //$_SESSION['fb_access_token'] = (string) $accessToken;
67 67
 try {
68
-  // Returns a `Facebook\FacebookResponse` object
69
-  $response = $fb->get('/me?fields=id,name', $accessToken);
68
+    // Returns a `Facebook\FacebookResponse` object
69
+    $response = $fb->get('/me?fields=id,name', $accessToken);
70 70
 } catch(Facebook\Exceptions\FacebookResponseException $e) {
71
-  echo 'Graph returned an error: ' . $e->getMessage();
72
-  exit;
71
+    echo 'Graph returned an error: ' . $e->getMessage();
72
+    exit;
73 73
 } catch(Facebook\Exceptions\FacebookSDKException $e) {
74
-  echo 'Facebook SDK returned an error: ' . $e->getMessage();
75
-  exit;
74
+    echo 'Facebook SDK returned an error: ' . $e->getMessage();
75
+    exit;
76 76
 }
77 77
 $user = $response->getGraphUser();
78 78
 
@@ -117,8 +117,8 @@  discard block
 block discarded – undo
117 117
 }
118 118
 
119 119
 if(isset($_GET['album_id']) && isset($_GET['album_name'])){
120
-  $album_id = $_GET['album_id'];
121
-  $album_name = $_GET['album_name']; //isset($_GET['album_name'])?:header('Location: fb-callback.php');
120
+    $album_id = $_GET['album_id'];
121
+    $album_name = $_GET['album_name']; //isset($_GET['album_name'])?:header('Location: fb-callback.php');
122 122
 
123 123
 // Get photos of Facebook page album using Facebook Graph API
124 124
 $graphPhoLink = "https://graph.facebook.com/v3.2/{$album_id}/photos?fields=source,images,name&access_token={$accessToken}";
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
         echo "<img src='{$imgSource}' alt='' style='width:100%'>";
145 145
         echo "<div class='text'>{$name}</div>";
146 146
         echo "</div>";
147
-      }
147
+        }
148 148
     }
149 149
 }
150 150
 ?>
151 151
\ No newline at end of file
Please login to merge, or discard this patch.