Passed
Push — master ( e34333...86363a )
by Rakesh
42s queued 10s
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 2 patches
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.
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 2 patches
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.
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.
appconfig.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -6,11 +6,11 @@
 block discarded – undo
6 6
 require_once('lib/Facebook/Authentication/AccessToken.php');
7 7
 require_once('lib/Facebook/HttpClients/FacebookCurl.php');
8 8
 require_once('lib/Facebook/HttpClients/FacebookCurlHttpClient.php');
9
-require_once('lib/Facebook/Helpers/FacebookRedirectLoginHelper.php' );
10
-require_once('lib/Facebook/FacebookRequest.php' );
11
-require_once('lib/Facebook/FacebookResponse.php' );
12
-require_once('lib/Facebook/Exceptions/FacebookSDKException.php' );
13
-require_once('lib/Facebook/Exceptions/FacebookAuthorizationException.php' );
9
+require_once('lib/Facebook/Helpers/FacebookRedirectLoginHelper.php');
10
+require_once('lib/Facebook/FacebookRequest.php');
11
+require_once('lib/Facebook/FacebookResponse.php');
12
+require_once('lib/Facebook/Exceptions/FacebookSDKException.php');
13
+require_once('lib/Facebook/Exceptions/FacebookAuthorizationException.php');
14 14
 
15 15
     $appId = '359690587983062'; // Facebook App id 589129311570125 589129311570125
16 16
     $appSecret = 'ee50a6453ab0da99c80521144f8baefe'; //92f90e5dff5c6bdc2da0281631ec0446  538cd04f971479ff14dc409df2fbcf3b
Please login to merge, or discard this patch.
lib/move_to_picasa.php 3 patches
Spacing   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -4,9 +4,9 @@  discard block
 block discarded – undo
4 4
 
5 5
 //============  Google Move Code ======================//
6 6
 
7
-if ( isset( $_GET['album_download_directory'] ) ) {
7
+if (isset($_GET['album_download_directory'])) {
8 8
 	$album_download_directory = $_GET['album_download_directory'];
9
-	$album_download_directory = '../'.$album_download_directory;
9
+	$album_download_directory = '../' . $album_download_directory;
10 10
 } else {
11 11
 	header('location:../index.php');
12 12
 }
@@ -18,8 +18,8 @@  discard block
 block discarded – undo
18 18
 
19 19
 
20 20
 function getAuthSubHttpClient() {
21
-	if ( isset( $_SESSION['google_session_token'] ) ) {
22
-		$client = Zend_Gdata_AuthSub::getHttpClient( $_SESSION['google_session_token'] );
21
+	if (isset($_SESSION['google_session_token'])) {
22
+		$client = Zend_Gdata_AuthSub::getHttpClient($_SESSION['google_session_token']);
23 23
 		return $client;
24 24
 	}
25 25
 }
@@ -28,77 +28,77 @@  discard block
 block discarded – undo
28 28
 $entry = new Zend_Gdata_Photos_AlbumEntry();
29 29
 
30 30
 
31
-function add_new_album( $entry, $gp, $album_download_directory, $album_name ) {
32
-	$new_album_name = str_replace( " ", "_", $album_name );
33
-	$new_album_name = $new_album_name.'_'.uniqid();
31
+function add_new_album($entry, $gp, $album_download_directory, $album_name) {
32
+	$new_album_name = str_replace(" ", "_", $album_name);
33
+	$new_album_name = $new_album_name . '_' . uniqid();
34 34
 
35
-	$entry->setTitle( $gp->newTitle( $new_album_name ) );
36
-	$entry->setSummary( $gp->newSummary("Album added by Facebook Album Challenge") );
37
-	$gp->insertAlbumEntry( $entry );
35
+	$entry->setTitle($gp->newTitle($new_album_name));
36
+	$entry->setSummary($gp->newSummary("Album added by Facebook Album Challenge"));
37
+	$gp->insertAlbumEntry($entry);
38 38
 
39
-	$path = $album_download_directory.$album_name;
40
-	if ( file_exists( $path ) ) {
41
-		$photos = scandir( $path );
39
+	$path = $album_download_directory . $album_name;
40
+	if (file_exists($path)) {
41
+		$photos = scandir($path);
42 42
 
43
-		foreach ( $photos as $photo ) {
44
-			if ( $photo != "." && $photo != ".." ) {
45
-				$photo_path = $path.'/'.$photo;
46
-				add_new_photo_to_album( $gp, $photo_path, $new_album_name );
43
+		foreach ($photos as $photo) {
44
+			if ($photo != "." && $photo != "..") {
45
+				$photo_path = $path . '/' . $photo;
46
+				add_new_photo_to_album($gp, $photo_path, $new_album_name);
47 47
 			}
48 48
 		}
49 49
 	}	
50 50
 }
51 51
 
52
-function add_new_photo_to_album( $gp, $path, $new_album_name ) {
52
+function add_new_photo_to_album($gp, $path, $new_album_name) {
53 53
 	$user_name = "default";
54 54
 	$file_name = $path;
55 55
 	$photo_name = "Photo added by Facebook Album Challenge";
56 56
 	$photo_caption = "Photo added by Facebook Album Challenge";
57 57
 	$photo_tags = "Photo, Facebook-Album-Challenge";
58 58
 
59
-	$fd = $gp->newMediaFileSource( $file_name );
59
+	$fd = $gp->newMediaFileSource($file_name);
60 60
 	$fd->setContentType("image/jpeg");
61 61
 
62 62
 	// Create a PhotoEntry
63 63
 	$photo_entry = $gp->newPhotoEntry();
64 64
 
65
-	$photo_entry->setMediaSource( $fd );
66
-	$photo_entry->setTitle( $gp->newTitle( $photo_name ) );
67
-	$photo_entry->setSummary( $gp->newSummary( $photo_caption ) );
65
+	$photo_entry->setMediaSource($fd);
66
+	$photo_entry->setTitle($gp->newTitle($photo_name));
67
+	$photo_entry->setSummary($gp->newSummary($photo_caption));
68 68
 
69 69
 	// add some tags
70 70
 	$photo_media = new Zend_Gdata_Media_Extension_MediaKeywords();
71
-	$photo_media->setText( $photo_tags );
71
+	$photo_media->setText($photo_tags);
72 72
 	$photo_entry->mediaGroup = new Zend_Gdata_Media_Extension_MediaGroup();
73 73
 	$photo_entry->mediaGroup->keywords = $photo_media;
74 74
 
75 75
 	// We use the AlbumQuery class to generate the URL for the album
76 76
 	$album_query = $gp->newAlbumQuery();
77 77
 
78
-	$album_query->setUser( $user_name );
78
+	$album_query->setUser($user_name);
79 79
 	//$albumQuery->setAlbumId($albumId);
80
-	$album_query->setAlbumName( $new_album_name );
80
+	$album_query->setAlbumName($new_album_name);
81 81
 
82 82
 	// We insert the photo, and the server returns the entry representing
83 83
 	// that photo after it is uploaded
84 84
 	//$insertedEntry = $gp->insertPhotoEntry( $photoEntry, $albumQuery->getQueryUrl() );
85
-	$gp->insertPhotoEntry( $photo_entry, $album_query->getQueryUrl() );
85
+	$gp->insertPhotoEntry($photo_entry, $album_query->getQueryUrl());
86 86
 }
87 87
 
88
-if ( isset( $album_download_directory ) ) {
89
-	if ( file_exists( $album_download_directory ) ) {
90
-		$album_names = scandir( $album_download_directory );
88
+if (isset($album_download_directory)) {
89
+	if (file_exists($album_download_directory)) {
90
+		$album_names = scandir($album_download_directory);
91 91
 
92
-		foreach ( $album_names as $album_name ) {
93
-			if ( $album_name != "." && $album_name != "..") {
94
-				add_new_album( $entry, $gp, $album_download_directory, $album_name );
92
+		foreach ($album_names as $album_name) {
93
+			if ($album_name != "." && $album_name != "..") {
94
+				add_new_album($entry, $gp, $album_download_directory, $album_name);
95 95
 			}
96 96
 		}
97 97
 
98
-		$unlink_folder = rtrim( $album_download_directory, "/" );
98
+		$unlink_folder = rtrim($album_download_directory, "/");
99 99
 		require_once('../unlink_directory.php');
100 100
 		$unlink_directory = new unlink_directory();
101
-		$unlink_directory->remove_directory( $unlink_folder );
101
+		$unlink_directory->remove_directory($unlink_folder);
102 102
 	}
103 103
 	$response = 1;
104 104
 } else {
@@ -106,10 +106,10 @@  discard block
 block discarded – undo
106 106
 }
107 107
 
108 108
 
109
-if ( isset( $_GET['ajax'] ) )
109
+if (isset($_GET['ajax']))
110 110
 	echo $response;
111 111
 else
112
-	header('location:../index.php?response='.$response);
112
+	header('location:../index.php?response=' . $response);
113 113
 
114 114
 
115 115
 ?>
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -106,10 +106,11 @@
 block discarded – undo
106 106
 }
107 107
 
108 108
 
109
-if ( isset( $_GET['ajax'] ) )
109
+if ( isset( $_GET['ajax'] ) ) {
110 110
 	echo $response;
111
-else
111
+} else {
112 112
 	header('location:../index.php?response='.$response);
113
+}
113 114
 
114 115
 
115 116
 ?>
Please login to merge, or discard this patch.
Indentation   +76 added lines, -76 removed lines patch added patch discarded remove patch
@@ -5,10 +5,10 @@  discard block
 block discarded – undo
5 5
 //============  Google Move Code ======================//
6 6
 
7 7
 if ( isset( $_GET['album_download_directory'] ) ) {
8
-	$album_download_directory = $_GET['album_download_directory'];
9
-	$album_download_directory = '../'.$album_download_directory;
8
+    $album_download_directory = $_GET['album_download_directory'];
9
+    $album_download_directory = '../'.$album_download_directory;
10 10
 } else {
11
-	header('location:../index.php');
11
+    header('location:../index.php');
12 12
 }
13 13
 
14 14
 require_once 'Zend/autooad.php';
@@ -18,10 +18,10 @@  discard block
 block discarded – undo
18 18
 
19 19
 
20 20
 function getAuthSubHttpClient() {
21
-	if ( isset( $_SESSION['google_session_token'] ) ) {
22
-		$client = Zend_Gdata_AuthSub::getHttpClient( $_SESSION['google_session_token'] );
23
-		return $client;
24
-	}
21
+    if ( isset( $_SESSION['google_session_token'] ) ) {
22
+        $client = Zend_Gdata_AuthSub::getHttpClient( $_SESSION['google_session_token'] );
23
+        return $client;
24
+    }
25 25
 }
26 26
 
27 27
 $gp = new Zend_Gdata_Photos(getAuthSubHttpClient(), "Google-DevelopersGuide-1.0");
@@ -29,87 +29,87 @@  discard block
 block discarded – undo
29 29
 
30 30
 
31 31
 function add_new_album( $entry, $gp, $album_download_directory, $album_name ) {
32
-	$new_album_name = str_replace( " ", "_", $album_name );
33
-	$new_album_name = $new_album_name.'_'.uniqid();
34
-
35
-	$entry->setTitle( $gp->newTitle( $new_album_name ) );
36
-	$entry->setSummary( $gp->newSummary("Album added by Facebook Album Challenge") );
37
-	$gp->insertAlbumEntry( $entry );
38
-
39
-	$path = $album_download_directory.$album_name;
40
-	if ( file_exists( $path ) ) {
41
-		$photos = scandir( $path );
42
-
43
-		foreach ( $photos as $photo ) {
44
-			if ( $photo != "." && $photo != ".." ) {
45
-				$photo_path = $path.'/'.$photo;
46
-				add_new_photo_to_album( $gp, $photo_path, $new_album_name );
47
-			}
48
-		}
49
-	}	
32
+    $new_album_name = str_replace( " ", "_", $album_name );
33
+    $new_album_name = $new_album_name.'_'.uniqid();
34
+
35
+    $entry->setTitle( $gp->newTitle( $new_album_name ) );
36
+    $entry->setSummary( $gp->newSummary("Album added by Facebook Album Challenge") );
37
+    $gp->insertAlbumEntry( $entry );
38
+
39
+    $path = $album_download_directory.$album_name;
40
+    if ( file_exists( $path ) ) {
41
+        $photos = scandir( $path );
42
+
43
+        foreach ( $photos as $photo ) {
44
+            if ( $photo != "." && $photo != ".." ) {
45
+                $photo_path = $path.'/'.$photo;
46
+                add_new_photo_to_album( $gp, $photo_path, $new_album_name );
47
+            }
48
+        }
49
+    }	
50 50
 }
51 51
 
52 52
 function add_new_photo_to_album( $gp, $path, $new_album_name ) {
53
-	$user_name = "default";
54
-	$file_name = $path;
55
-	$photo_name = "Photo added by Facebook Album Challenge";
56
-	$photo_caption = "Photo added by Facebook Album Challenge";
57
-	$photo_tags = "Photo, Facebook-Album-Challenge";
58
-
59
-	$fd = $gp->newMediaFileSource( $file_name );
60
-	$fd->setContentType("image/jpeg");
61
-
62
-	// Create a PhotoEntry
63
-	$photo_entry = $gp->newPhotoEntry();
64
-
65
-	$photo_entry->setMediaSource( $fd );
66
-	$photo_entry->setTitle( $gp->newTitle( $photo_name ) );
67
-	$photo_entry->setSummary( $gp->newSummary( $photo_caption ) );
68
-
69
-	// add some tags
70
-	$photo_media = new Zend_Gdata_Media_Extension_MediaKeywords();
71
-	$photo_media->setText( $photo_tags );
72
-	$photo_entry->mediaGroup = new Zend_Gdata_Media_Extension_MediaGroup();
73
-	$photo_entry->mediaGroup->keywords = $photo_media;
74
-
75
-	// We use the AlbumQuery class to generate the URL for the album
76
-	$album_query = $gp->newAlbumQuery();
77
-
78
-	$album_query->setUser( $user_name );
79
-	//$albumQuery->setAlbumId($albumId);
80
-	$album_query->setAlbumName( $new_album_name );
81
-
82
-	// We insert the photo, and the server returns the entry representing
83
-	// that photo after it is uploaded
84
-	//$insertedEntry = $gp->insertPhotoEntry( $photoEntry, $albumQuery->getQueryUrl() );
85
-	$gp->insertPhotoEntry( $photo_entry, $album_query->getQueryUrl() );
53
+    $user_name = "default";
54
+    $file_name = $path;
55
+    $photo_name = "Photo added by Facebook Album Challenge";
56
+    $photo_caption = "Photo added by Facebook Album Challenge";
57
+    $photo_tags = "Photo, Facebook-Album-Challenge";
58
+
59
+    $fd = $gp->newMediaFileSource( $file_name );
60
+    $fd->setContentType("image/jpeg");
61
+
62
+    // Create a PhotoEntry
63
+    $photo_entry = $gp->newPhotoEntry();
64
+
65
+    $photo_entry->setMediaSource( $fd );
66
+    $photo_entry->setTitle( $gp->newTitle( $photo_name ) );
67
+    $photo_entry->setSummary( $gp->newSummary( $photo_caption ) );
68
+
69
+    // add some tags
70
+    $photo_media = new Zend_Gdata_Media_Extension_MediaKeywords();
71
+    $photo_media->setText( $photo_tags );
72
+    $photo_entry->mediaGroup = new Zend_Gdata_Media_Extension_MediaGroup();
73
+    $photo_entry->mediaGroup->keywords = $photo_media;
74
+
75
+    // We use the AlbumQuery class to generate the URL for the album
76
+    $album_query = $gp->newAlbumQuery();
77
+
78
+    $album_query->setUser( $user_name );
79
+    //$albumQuery->setAlbumId($albumId);
80
+    $album_query->setAlbumName( $new_album_name );
81
+
82
+    // We insert the photo, and the server returns the entry representing
83
+    // that photo after it is uploaded
84
+    //$insertedEntry = $gp->insertPhotoEntry( $photoEntry, $albumQuery->getQueryUrl() );
85
+    $gp->insertPhotoEntry( $photo_entry, $album_query->getQueryUrl() );
86 86
 }
87 87
 
88 88
 if ( isset( $album_download_directory ) ) {
89
-	if ( file_exists( $album_download_directory ) ) {
90
-		$album_names = scandir( $album_download_directory );
91
-
92
-		foreach ( $album_names as $album_name ) {
93
-			if ( $album_name != "." && $album_name != "..") {
94
-				add_new_album( $entry, $gp, $album_download_directory, $album_name );
95
-			}
96
-		}
97
-
98
-		$unlink_folder = rtrim( $album_download_directory, "/" );
99
-		require_once('../unlink_directory.php');
100
-		$unlink_directory = new unlink_directory();
101
-		$unlink_directory->remove_directory( $unlink_folder );
102
-	}
103
-	$response = 1;
89
+    if ( file_exists( $album_download_directory ) ) {
90
+        $album_names = scandir( $album_download_directory );
91
+
92
+        foreach ( $album_names as $album_name ) {
93
+            if ( $album_name != "." && $album_name != "..") {
94
+                add_new_album( $entry, $gp, $album_download_directory, $album_name );
95
+            }
96
+        }
97
+
98
+        $unlink_folder = rtrim( $album_download_directory, "/" );
99
+        require_once('../unlink_directory.php');
100
+        $unlink_directory = new unlink_directory();
101
+        $unlink_directory->remove_directory( $unlink_folder );
102
+    }
103
+    $response = 1;
104 104
 } else {
105
-	$response = 0;
105
+    $response = 0;
106 106
 }
107 107
 
108 108
 
109 109
 if ( isset( $_GET['ajax'] ) )
110
-	echo $response;
110
+    echo $response;
111 111
 else
112
-	header('location:../index.php?response='.$response);
112
+    header('location:../index.php?response='.$response);
113 113
 
114 114
 
115 115
 ?>
Please login to merge, or discard this patch.