Passed
Push — master ( e34333...86363a )
by Rakesh
42s queued 10s
created
unlink_directory.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,16 +1,16 @@
 block discarded – undo
1 1
 <?php
2 2
 class unlink_directory {
3 3
 	
4
-    function remove_directory( $directory ) {
5
-        if ( isset( $directory ) ) {
6
-            foreach ( glob( "{$directory}/*" ) as $file ) {
7
-                if ( is_dir( $file ) ) { 
8
-                    $this->remove_directory( $file );
4
+    function remove_directory($directory) {
5
+        if (isset($directory)) {
6
+            foreach (glob("{$directory}/*") as $file) {
7
+                if (is_dir($file)) { 
8
+                    $this->remove_directory($file);
9 9
                 } else {
10
-                    unlink( $file );
10
+                    unlink($file);
11 11
                 }
12 12
             }
13
-            rmdir( $directory );
13
+            rmdir($directory);
14 14
         }
15 15
     }
16 16
 }
17 17
\ No newline at end of file
Please login to merge, or discard this patch.
zipper.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 		$t = 0;
61 61
 
62 62
 		// Determine how many zip files to create
63
-		if ( isset( $foldercontent ) ) {
63
+		if (isset($foldercontent)) {
64 64
 			foreach ($foldercontent as $entry) {
65 65
 	
66 66
 				$t = $t + $entry['size'];
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
 						$dir = explode('\\', $entry['file']);
110 110
 						$zip->addEmptyDir(end($dir));
111 111
 					} else {
112
-						$zip->addFromString(end($dir).'/'.$i.'.jpg', file_get_contents($entry['file']));
112
+						$zip->addFromString(end($dir) . '/' . $i . '.jpg', file_get_contents($entry['file']));
113 113
 						$i++;
114 114
 					}
115 115
 				}
@@ -138,15 +138,15 @@  discard block
 block discarded – undo
138 138
 
139 139
 	public function make_zip($album_download_directory) {
140 140
 		$zipfilename = "";
141
-		if ( isset( $album_download_directory) ) {
141
+		if (isset($album_download_directory)) {
142 142
 			//$zipfilename = 'libs/resources'.DIRECTORY_SEPARATOR.'albums'.DIRECTORY_SEPARATOR.'fb-album_'.date("Y-m-d").'_'.date("H-i-s");
143
-			$zipfilename = 'lib/resources/albums/fb-album_'.date("Y-m-d").'_'.date("H-i-s");
143
+			$zipfilename = 'lib/resources/albums/fb-album_' . date("Y-m-d") . '_' . date("H-i-s");
144 144
 	
145 145
 			// name of folder starting from the root of the webserver
146 146
 			// as in Wordpress /wp-content/themes/ (end on backslash)
147 147
 	
148 148
 	
149
-			$folder = dirname($_SERVER['PHP_SELF']).'/'.$album_download_directory;
149
+			$folder = dirname($_SERVER['PHP_SELF']) . '/' . $album_download_directory;
150 150
 	
151 151
 			// Server Root
152 152
 			$root = $_SERVER["DOCUMENT_ROOT"];
@@ -180,18 +180,18 @@  discard block
 block discarded – undo
180 180
 			// clear the stat cache (created by filesize command)
181 181
 			clearstatcache();
182 182
 			
183
-			require_once( 'unlink_directory.php' );
183
+			require_once('unlink_directory.php');
184 184
 			$unlink_directory = new unlink_directory();
185
-			$unlink_directory->remove_directory( $album_download_directory );
185
+			$unlink_directory->remove_directory($album_download_directory);
186 186
 		}
187 187
 		return $zipfilename;
188 188
 	}
189 189
 
190
-	public function get_zip( $album_download_directory ) {
190
+	public function get_zip($album_download_directory) {
191 191
 		$response = '<span style="color: #ffffff;">Sorry due to some reasons albums cannot be downloaded.</span>';
192
-		if ( isset( $album_download_directory ) ) {
193
-			$zip_folder = $this->make_zip( $album_download_directory );
194
-			if ( !empty( $zip_folder ) ) {
192
+		if (isset($album_download_directory)) {
193
+			$zip_folder = $this->make_zip($album_download_directory);
194
+			if (!empty($zip_folder)) {
195 195
 				$response = '<a href="' . $zip_folder . '.zip" id="download-link" class="btn btn-success link-buttons-border-color" >Download Zip Folder</a>';
196 196
 			}
197 197
 		}
Please login to merge, or discard this patch.
index.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -8,8 +8,8 @@
 block discarded – undo
8 8
   'default_graph_version' => 'v3.3',
9 9
   ]);
10 10
   $helper = $fb->getRedirectLoginHelper();  
11
-  $permissions = ['email','user_photos','user_videos','user_posts','user_link','user_status','user_link']; // Optional permissions
12
-  $loginUrl = $helper->getLoginUrl($CallbackUrl,$permissions);
11
+  $permissions = ['email', 'user_photos', 'user_videos', 'user_posts', 'user_link', 'user_status', 'user_link']; // Optional permissions
12
+  $loginUrl = $helper->getLoginUrl($CallbackUrl, $permissions);
13 13
   
14 14
   echo "<h3> Connect Clicking Below Facebook Icon Using Your Facebook Account.<h3>";
15
-  echo '<a href="' .htmlspecialchars($loginUrl).'"><img alt="Login With Facebook" src="images/fb_icon.png"></a>';
16 15
\ No newline at end of file
16
+  echo '<a href="' . htmlspecialchars($loginUrl) . '"><img alt="Login With Facebook" src="images/fb_icon.png"></a>';
17 17
\ No newline at end of file
Please login to merge, or discard this patch.
fb-callback.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -16,11 +16,11 @@  discard block
 block discarded – undo
16 16
 $helper = $fb->getRedirectLoginHelper();
17 17
 try {
18 18
     $accessToken = $helper->getAccessToken();
19
-} catch(Facebook\Exceptions\FacebookResponseException $e) {
19
+} catch (Facebook\Exceptions\FacebookResponseException $e) {
20 20
     // When Graph returns an error
21 21
     echo 'Graph returned an error: ' . $e->getMessage();
22 22
     exit;
23
-} catch(Facebook\Exceptions\FacebookSDKException $e) {
23
+} catch (Facebook\Exceptions\FacebookSDKException $e) {
24 24
     // When validation fails or other local issues
25 25
     echo 'Facebook SDK returned an error: ' . $e->getMessage();
26 26
     exit;
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 // If you know the user ID this access token belongs to, you can validate it here
53 53
 //$tokenMetadata->validateUserId('123');
54 54
 $tokenMetadata->validateExpiration();
55
-if (! $accessToken->isLongLived()) {
55
+if (!$accessToken->isLongLived()) {
56 56
     // Exchanges a short-lived access token for a long-lived one
57 57
     try {
58 58
     $accessToken = $oAuth2Client->getLongLivedAccessToken($accessToken);
Please login to merge, or discard this patch.
lib/Google/Utils/UriTemplate.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
    */
49 49
   private $reserved = array(
50 50
       "=", ",", "!", "@", "|", ":", "/", "?", "#",
51
-      "[", "]",'$', "&", "'", "(", ")", "*", "+", ";"
51
+      "[", "]", '$', "&", "'", "(", ")", "*", "+", ";"
52 52
   );
53 53
   private $reservedEncoded = array(
54 54
     "%3D", "%2C", "%21", "%40", "%7C", "%3A", "%2F", "%3F",
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
         case "segments":
108 108
           // Slash separated data. Bare values only.
109 109
           $prefix = "/";
110
-          $data =$this->replaceVars($data, $parameters, "/");
110
+          $data = $this->replaceVars($data, $parameters, "/");
111 111
           break;
112 112
         case "dotprefix":
113 113
           // Dot separated data. Bare values only.
Please login to merge, or discard this patch.
lib/Google/Service/Resource.php 1 patch
Spacing   +6 added lines, -7 removed lines patch added patch discarded remove patch
@@ -65,8 +65,7 @@  discard block
 block discarded – undo
65 65
     $this->serviceName = $serviceName;
66 66
     $this->resourceName = $resourceName;
67 67
     $this->methods = is_array($resource) && isset($resource['methods']) ?
68
-        $resource['methods'] :
69
-        array($resourceName => $resource);
68
+        $resource['methods'] : array($resourceName => $resource);
70 69
   }
71 70
 
72 71
   /**
@@ -79,7 +78,7 @@  discard block
 block discarded – undo
79 78
    */
80 79
   public function call($name, $arguments, $expectedClass = null)
81 80
   {
82
-    if (! isset($this->methods[$name])) {
81
+    if (!isset($this->methods[$name])) {
83 82
       $this->client->getLogger()->error(
84 83
           'Service method unknown',
85 84
           array(
@@ -112,7 +111,7 @@  discard block
 block discarded – undo
112 111
         $parameters['postBody'] =
113 112
             $this->convertToArrayAndStripNulls($parameters['postBody']);
114 113
       }
115
-      $postBody = (array) $parameters['postBody'];
114
+      $postBody = (array)$parameters['postBody'];
116 115
       unset($parameters['postBody']);
117 116
     }
118 117
 
@@ -134,7 +133,7 @@  discard block
 block discarded – undo
134 133
     );
135 134
 
136 135
     foreach ($parameters as $key => $val) {
137
-      if ($key != 'postBody' && ! isset($method['parameters'][$key])) {
136
+      if ($key != 'postBody' && !isset($method['parameters'][$key])) {
138 137
         $this->client->getLogger()->error(
139 138
             'Service parameter unknown',
140 139
             array(
@@ -151,7 +150,7 @@  discard block
 block discarded – undo
151 150
     foreach ($method['parameters'] as $paramName => $paramSpec) {
152 151
       if (isset($paramSpec['required']) &&
153 152
           $paramSpec['required'] &&
154
-          ! isset($parameters[$paramName])
153
+          !isset($parameters[$paramName])
155 154
       ) {
156 155
         $this->client->getLogger()->error(
157 156
             'Service parameter missing',
@@ -234,7 +233,7 @@  discard block
 block discarded – undo
234 233
 
235 234
   protected function convertToArrayAndStripNulls($o)
236 235
   {
237
-    $o = (array) $o;
236
+    $o = (array)$o;
238 237
     foreach ($o as $k => $v) {
239 238
       if ($v === null) {
240 239
         unset($o[$k]);
Please login to merge, or discard this patch.
lib/Google/AuthHandler/Guzzle5AuthHandler.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@
 block discarded – undo
56 56
 
57 57
   public function attachToken(ClientInterface $http, array $token, array $scopes)
58 58
   {
59
-    $tokenFunc = function ($scopes) use ($token) {
59
+    $tokenFunc = function($scopes) use ($token) {
60 60
       return $token['access_token'];
61 61
     };
62 62
 
Please login to merge, or discard this patch.
lib/Google/Client.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -341,7 +341,7 @@  discard block
 block discarded – undo
341 341
 
342 342
     $auth = $this->getOAuth2Service();
343 343
 
344
-    return (string) $auth->buildFullAuthorizationUri($params);
344
+    return (string)$auth->buildFullAuthorizationUri($params);
345 345
   }
346 346
 
347 347
   /**
@@ -384,7 +384,7 @@  discard block
 block discarded – undo
384 384
       $callback = $this->config['token_callback'];
385 385
       $http = $authHandler->attachCredentials($http, $credentials, $callback);
386 386
     } elseif ($token) {
387
-      $http = $authHandler->attachToken($http, $token, (array) $scopes);
387
+      $http = $authHandler->attachToken($http, $token, (array)$scopes);
388 388
     } elseif ($key = $this->config['developer_key']) {
389 389
       $http = $authHandler->attachKey($http, $key);
390 390
     }
@@ -1076,7 +1076,7 @@  discard block
 block discarded – undo
1076 1076
    */
1077 1077
   public function setApiFormatV2($value)
1078 1078
   {
1079
-    $this->config['api_format_v2'] = (bool) $value;
1079
+    $this->config['api_format_v2'] = (bool)$value;
1080 1080
   }
1081 1081
 
1082 1082
   protected function createDefaultHttpClient()
@@ -1091,7 +1091,7 @@  discard block
 block discarded – undo
1091 1091
       ];
1092 1092
       if ($this->isAppEngine()) {
1093 1093
         // set StreamHandler on AppEngine by default
1094
-        $options['handler']  = new StreamHandler();
1094
+        $options['handler'] = new StreamHandler();
1095 1095
         $options['defaults']['verify'] = '/etc/ca-certificates.crt';
1096 1096
       }
1097 1097
     } else {
Please login to merge, or discard this patch.
lib/Google/Model.php 1 patch
Spacing   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -254,8 +254,7 @@
 block discarded – undo
254 254
   public function offsetGet($offset)
255 255
   {
256 256
     return isset($this->$offset) ?
257
-        $this->$offset :
258
-        $this->__get($offset);
257
+        $this->$offset : $this->__get($offset);
259 258
   }
260 259
 
261 260
   public function offsetSet($offset, $value)
Please login to merge, or discard this patch.