Passed
Push — master ( edeaab...e589dd )
by Rakesh
02:10
created
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', $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.
index.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 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
 
@@ -17,5 +17,5 @@  discard block
 block discarded – undo
17 17
 $loginUrl = $helper->getLoginUrl('https://localhost/rtCamp/fb-callback.php', $permissions);
18 18
 
19 19
 echo "<h3> Connect Clicking Below Facebook Icon Using Your Facebook Account.<h3>";
20
-echo '<a href="' .htmlspecialchars($loginUrl).'"><img alt="Login With Facebook" src="images/fb_icon.png"></a>';
20
+echo '<a href="' . htmlspecialchars($loginUrl) . '"><img alt="Login With Facebook" src="images/fb_icon.png"></a>';
21 21
 ?>
22 22
\ No newline at end of file
Please login to merge, or discard this patch.