Completed
Pull Request — master (#160)
by Lito
04:39
created
src/Dropbox/Security/RandomStringGeneratorFactory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@
 block discarded – undo
57 57
     protected static function defaultRandomStringGenerator()
58 58
     {
59 59
         //Mcrypt
60
-        if (function_exists('mcrypt_create_iv') && version_compare( PHP_VERSION, '7.1', '<' )) {
60
+        if (function_exists('mcrypt_create_iv') && version_compare(PHP_VERSION, '7.1', '<')) {
61 61
             return new McryptRandomStringGenerator();
62 62
         }
63 63
 
Please login to merge, or discard this patch.
src/Dropbox/Dropbox.php 4 patches
Doc Comments   +5 added lines, -6 removed lines patch added patch discarded remove patch
@@ -487,7 +487,6 @@  discard block
 block discarded – undo
487 487
 	/**
488 488
      * Search a folder for files/folders
489 489
      *
490
-     * @param  string $path   Path to search
491 490
      * @param  string $query  Search Query
492 491
      * @param  array  $params Additional Params
493 492
      *
@@ -907,7 +906,7 @@  discard block
 block discarded – undo
907 906
     /**
908 907
      * Upload file in sessions/chunks
909 908
      *
910
-     * @param string|DropboxFile $dropboxFile DropboxFile object or Path to file
909
+     * @param DropboxFile $dropboxFile DropboxFile object or Path to file
911 910
      * @param string $path Path to save the file to, on Dropbox
912 911
      * @param int $fileSize The size of the file
913 912
      * @param int $chunkSize The amount of data to upload in each chunk
@@ -972,7 +971,7 @@  discard block
 block discarded – undo
972 971
     /**
973 972
      * Start an Upload Session
974 973
      *
975
-     * @param string|DropboxFile $dropboxFile DropboxFile object or Path to file
974
+     * @param string $dropboxFile DropboxFile object or Path to file
976 975
      * @param int $chunkSize Size of file chunk to upload
977 976
      * @param boolean $close Closes the session for "appendUploadSession"
978 977
      *
@@ -1025,7 +1024,7 @@  discard block
 block discarded – undo
1025 1024
     /**
1026 1025
      * Append more data to an Upload Session
1027 1026
      *
1028
-     * @param string|DropboxFile $dropboxFile DropboxFile object or Path to file
1027
+     * @param DropboxFile $dropboxFile DropboxFile object or Path to file
1029 1028
      * @param string $sessionId Session ID returned by `startUploadSession`
1030 1029
      * @param int $offset The amount of data that has been uploaded so far
1031 1030
      * @param int $chunkSize The amount of data to upload
@@ -1074,7 +1073,7 @@  discard block
 block discarded – undo
1074 1073
     /**
1075 1074
      * Finish an upload session and save the uploaded data to the given file path
1076 1075
      *
1077
-     * @param string|DropboxFile $dropboxFile DropboxFile object or Path to file
1076
+     * @param DropboxFile $dropboxFile DropboxFile object or Path to file
1078 1077
      * @param string $sessionId Session ID returned by `startUploadSession`
1079 1078
      * @param int $offset The amount of data that has been uploaded so far
1080 1079
      * @param int $remaining The amount of data that is remaining
@@ -1122,7 +1121,7 @@  discard block
 block discarded – undo
1122 1121
     /**
1123 1122
      * Upload a File to Dropbox in a single request
1124 1123
      *
1125
-     * @param string|DropboxFile $dropboxFile DropboxFile object or Path to file
1124
+     * @param DropboxFile $dropboxFile DropboxFile object or Path to file
1126 1125
      * @param string $path Path to upload the file to
1127 1126
      * @param array $params Additional Params
1128 1127
      *
Please login to merge, or discard this patch.
Unused Use Statements   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -2,24 +2,24 @@
 block discarded – undo
2 2
 
3 3
 namespace Kunnu\Dropbox;
4 4
 
5
+use Kunnu\Dropbox\Authentication\DropboxAuthHelper;
6
+use Kunnu\Dropbox\Authentication\OAuth2Client;
7
+use Kunnu\Dropbox\Exceptions\DropboxClientException;
5 8
 use Kunnu\Dropbox\Exceptions\DropboxClientUnableToOpenTempFileException;
6 9
 use Kunnu\Dropbox\Exceptions\DropboxClientUnableToWriteToTempException;
7
-use Kunnu\Dropbox\Models\DeletedMetadata;
8
-use Kunnu\Dropbox\Models\File;
10
+use Kunnu\Dropbox\Http\Clients\DropboxHttpClientFactory;
9 11
 use Kunnu\Dropbox\Models\Account;
10
-use Kunnu\Dropbox\Models\Thumbnail;
11 12
 use Kunnu\Dropbox\Models\AccountList;
12
-use Kunnu\Dropbox\Models\ModelFactory;
13
-use Kunnu\Dropbox\Models\FileMetadata;
14 13
 use Kunnu\Dropbox\Models\CopyReference;
14
+use Kunnu\Dropbox\Models\DeletedMetadata;
15
+use Kunnu\Dropbox\Models\File;
16
+use Kunnu\Dropbox\Models\FileMetadata;
15 17
 use Kunnu\Dropbox\Models\FolderMetadata;
16 18
 use Kunnu\Dropbox\Models\ModelCollection;
17
-use Kunnu\Dropbox\Authentication\OAuth2Client;
18
-use Kunnu\Dropbox\Store\PersistentDataStoreFactory;
19
-use Kunnu\Dropbox\Authentication\DropboxAuthHelper;
20
-use Kunnu\Dropbox\Exceptions\DropboxClientException;
19
+use Kunnu\Dropbox\Models\ModelFactory;
20
+use Kunnu\Dropbox\Models\Thumbnail;
21 21
 use Kunnu\Dropbox\Security\RandomStringGeneratorFactory;
22
-use Kunnu\Dropbox\Http\Clients\DropboxHttpClientFactory;
22
+use Kunnu\Dropbox\Store\PersistentDataStoreFactory;
23 23
 
24 24
 /**
25 25
  * Dropbox
Please login to merge, or discard this patch.
Indentation   +49 added lines, -49 removed lines patch added patch discarded remove patch
@@ -484,17 +484,17 @@  discard block
 block discarded – undo
484 484
         return $this->makeModelFromResponse($response);
485 485
     }
486 486
 
487
-	/**
488
-     * Search a folder for files/folders
489
-     *
490
-     * @param  string $path   Path to search
491
-     * @param  string $query  Search Query
492
-     * @param  array  $params Additional Params
493
-     *
494
-     * @link https://www.dropbox.com/developers/documentation/http/documentation#files-search
495
-     *
496
-     * @return \Kunnu\Dropbox\Models\SearchResults
497
-     */
487
+ /**
488
+  * Search a folder for files/folders
489
+  *
490
+  * @param  string $path   Path to search
491
+  * @param  string $query  Search Query
492
+  * @param  array  $params Additional Params
493
+  *
494
+  * @link https://www.dropbox.com/developers/documentation/http/documentation#files-search
495
+  *
496
+  * @return \Kunnu\Dropbox\Models\SearchResults
497
+  */
498 498
     public function searchV2($query, array $params = [])
499 499
     {
500 500
         //Specify the root folder as an
@@ -506,9 +506,9 @@  discard block
 block discarded – undo
506 506
         //Set the path and query
507 507
         $params['query'] = $query;
508 508
 
509
-		if( !array_key_exists( 'include_highlights', $params ) ){
510
-			$params['include_highlights'] = false;
511
-		}
509
+  if( !array_key_exists( 'include_highlights', $params ) ){
510
+   $params['include_highlights'] = false;
511
+  }
512 512
 
513 513
         //Fetch Search Results
514 514
         $response = $this->postToAPI('/files/search_v2', $params);
@@ -1282,41 +1282,41 @@  discard block
 block discarded – undo
1282 1282
         return new File($metadata, $contents);
1283 1283
     }
1284 1284
 
1285
-	/**
1286
-	 * Download a folder as a zip file
1287
-	 *
1288
-	 * @param  string                  $path        Path to the file you want to download
1289
-	 * @param  null|string|DropboxFile $dropboxFile DropboxFile object or Path to target file
1290
-	 *
1291
-	 * @return \Kunnu\Dropbox\Models\File
1292
-	 *
1293
-	 * @throws \Kunnu\Dropbox\Exceptions\DropboxClientException
1294
-	 *
1295
-	 * @link https://www.dropbox.com/developers/documentation/http/documentation#files-download_zip
1296
-	 *
1297
-	 */
1298
-	 public function downloadZip($path, $dropboxFile = null)
1299
-	 {
1300
-		 //Path cannot be null
1301
-		 if (is_null($path)) {
1302
-			 throw new DropboxClientException("Path cannot be null.");
1303
-		 }
1304
-
1305
-		 //Make Dropbox File if target is specified
1306
-		 $dropboxFile = $dropboxFile ? $this->makeDropboxFile($dropboxFile, null, null, DropboxFile::MODE_WRITE) : null;
1307
-
1308
-		 //Download File
1309
-		 $response = $this->postToContent('/files/download_zip', ['path' => $path], null, $dropboxFile);
1310
-
1311
-		 //Get file metadata from response headers
1312
-		 $metadata = $this->getMetadataFromResponseHeaders($response);
1313
-
1314
-		 //File Contents
1315
-		 $contents = $dropboxFile ? $this->makeDropboxFile($dropboxFile) : $response->getBody();
1316
-
1317
-		 //Make and return a File model
1318
-		 return new File($metadata, $contents);
1319
-	}
1285
+ /**
1286
+  * Download a folder as a zip file
1287
+  *
1288
+  * @param  string                  $path        Path to the file you want to download
1289
+  * @param  null|string|DropboxFile $dropboxFile DropboxFile object or Path to target file
1290
+  *
1291
+  * @return \Kunnu\Dropbox\Models\File
1292
+  *
1293
+  * @throws \Kunnu\Dropbox\Exceptions\DropboxClientException
1294
+  *
1295
+  * @link https://www.dropbox.com/developers/documentation/http/documentation#files-download_zip
1296
+  *
1297
+  */
1298
+  public function downloadZip($path, $dropboxFile = null)
1299
+  {
1300
+   //Path cannot be null
1301
+   if (is_null($path)) {
1302
+    throw new DropboxClientException("Path cannot be null.");
1303
+   }
1304
+
1305
+   //Make Dropbox File if target is specified
1306
+   $dropboxFile = $dropboxFile ? $this->makeDropboxFile($dropboxFile, null, null, DropboxFile::MODE_WRITE) : null;
1307
+
1308
+   //Download File
1309
+   $response = $this->postToContent('/files/download_zip', ['path' => $path], null, $dropboxFile);
1310
+
1311
+   //Get file metadata from response headers
1312
+   $metadata = $this->getMetadataFromResponseHeaders($response);
1313
+
1314
+   //File Contents
1315
+   $contents = $dropboxFile ? $this->makeDropboxFile($dropboxFile) : $response->getBody();
1316
+
1317
+   //Make and return a File model
1318
+   return new File($metadata, $contents);
1319
+ }
1320 1320
 
1321 1321
     /**
1322 1322
      * Get Current Account
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -506,7 +506,7 @@  discard block
 block discarded – undo
506 506
         //Set the path and query
507 507
         $params['query'] = $query;
508 508
 
509
-		if( !array_key_exists( 'include_highlights', $params ) ){
509
+		if (!array_key_exists('include_highlights', $params)) {
510 510
 			$params['include_highlights'] = false;
511 511
 		}
512 512
 
@@ -1239,7 +1239,7 @@  discard block
 block discarded – undo
1239 1239
 
1240 1240
             //Since the metadata is returned as a json string
1241 1241
             //it needs to be decoded into an associative array
1242
-            $metadata = json_decode((string)$data, true);
1242
+            $metadata = json_decode((string) $data, true);
1243 1243
         }
1244 1244
 
1245 1245
         //Return the metadata
Please login to merge, or discard this patch.