@@ -140,7 +140,7 @@ |
||
140 | 140 | * @return bool |
141 | 141 | */ |
142 | 142 | public function isFlagSet($flag) { |
143 | - return (bool)($this->flags & $flag); |
|
143 | + return (bool) ($this->flags & $flag); |
|
144 | 144 | } |
145 | 145 | |
146 | 146 | /** |
@@ -51,7 +51,7 @@ |
||
51 | 51 | ->addParameters([]); |
52 | 52 | } |
53 | 53 | |
54 | - public function manipulateStorageConfig(StorageConfig &$storage, IUser $user = null) { |
|
54 | + public function manipulateStorageConfig(StorageConfig & $storage, IUser $user = null) { |
|
55 | 55 | try { |
56 | 56 | $credentials = $this->credentialsStore->getLoginCredentials(); |
57 | 57 | } catch (CredentialsUnavailableException $e) { |
@@ -75,7 +75,7 @@ |
||
75 | 75 | $this->credentialsManager->store($userId, self::CREDENTIALS_IDENTIFIER, $credentials); |
76 | 76 | } |
77 | 77 | |
78 | - public function manipulateStorageConfig(StorageConfig &$storage, IUser $user = null) { |
|
78 | + public function manipulateStorageConfig(StorageConfig & $storage, IUser $user = null) { |
|
79 | 79 | if (!isset($user)) { |
80 | 80 | throw new InsufficientDataForMeaningfulAnswerException('No login credentials saved'); |
81 | 81 | } |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | } |
62 | 62 | |
63 | 63 | private function getCredentialsIdentifier($storageId) { |
64 | - return self::CREDENTIALS_IDENTIFIER_PREFIX . $storageId; |
|
64 | + return self::CREDENTIALS_IDENTIFIER_PREFIX.$storageId; |
|
65 | 65 | } |
66 | 66 | |
67 | 67 | public function saveBackendOptions(IUser $user, $id, array $options) { |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | ]); |
72 | 72 | } |
73 | 73 | |
74 | - public function manipulateStorageConfig(StorageConfig &$storage, IUser $user = null) { |
|
74 | + public function manipulateStorageConfig(StorageConfig & $storage, IUser $user = null) { |
|
75 | 75 | if (!isset($user)) { |
76 | 76 | throw new InsufficientDataForMeaningfulAnswerException('No credentials saved'); |
77 | 77 | } |
@@ -70,7 +70,7 @@ |
||
70 | 70 | ]); |
71 | 71 | } |
72 | 72 | |
73 | - public function manipulateStorageConfig(StorageConfig &$storage, IUser $user = null) { |
|
73 | + public function manipulateStorageConfig(StorageConfig & $storage, IUser $user = null) { |
|
74 | 74 | if ($storage->getType() === StorageConfig::MOUNT_TYPE_ADMIN) { |
75 | 75 | $uid = ''; |
76 | 76 | } elseif (is_null($user)) { |
@@ -57,7 +57,7 @@ |
||
57 | 57 | ; |
58 | 58 | } |
59 | 59 | |
60 | - public function manipulateStorageConfig(StorageConfig &$storage, IUser $user = null) { |
|
60 | + public function manipulateStorageConfig(StorageConfig & $storage, IUser $user = null) { |
|
61 | 61 | $auth = new RSACrypt(); |
62 | 62 | $auth->setPassword($this->config->getSystemValue('secret', '')); |
63 | 63 | if (!$auth->loadKey($storage->getBackendOption('private_key'))) { |
@@ -47,10 +47,10 @@ |
||
47 | 47 | return false; |
48 | 48 | } |
49 | 49 | while (($file = readdir($dh)) !== false) { |
50 | - if ($this->is_dir($path . '/' . $file)) { |
|
51 | - $this->rmdir($path . '/' . $file); |
|
50 | + if ($this->is_dir($path.'/'.$file)) { |
|
51 | + $this->rmdir($path.'/'.$file); |
|
52 | 52 | } else { |
53 | - $this->unlink($path . '/' . $file); |
|
53 | + $this->unlink($path.'/'.$file); |
|
54 | 54 | } |
55 | 55 | } |
56 | 56 | $url = $this->constructUrl($path); |
@@ -36,8 +36,8 @@ discard block |
||
36 | 36 | |
37 | 37 | namespace OCA\Files_External\Lib\Storage; |
38 | 38 | |
39 | -set_include_path(get_include_path() . PATH_SEPARATOR . |
|
40 | - \OC_App::getAppPath('files_external') . '/3rdparty/aws-sdk-php'); |
|
39 | +set_include_path(get_include_path().PATH_SEPARATOR. |
|
40 | + \OC_App::getAppPath('files_external').'/3rdparty/aws-sdk-php'); |
|
41 | 41 | require_once 'aws-autoloader.php'; |
42 | 42 | |
43 | 43 | use Aws\S3\S3Client; |
@@ -95,8 +95,8 @@ discard block |
||
95 | 95 | * |
96 | 96 | * @param array $params |
97 | 97 | */ |
98 | - public function updateLegacyId (array $params) { |
|
99 | - $oldId = 'amazon::' . $params['key'] . md5($params['secret']); |
|
98 | + public function updateLegacyId(array $params) { |
|
99 | + $oldId = 'amazon::'.$params['key'].md5($params['secret']); |
|
100 | 100 | |
101 | 101 | // find by old id or bucket |
102 | 102 | $stmt = \OC::$server->getDatabaseConnection()->prepare( |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | try { |
149 | 149 | $this->getConnection()->putObject(array( |
150 | 150 | 'Bucket' => $this->bucket, |
151 | - 'Key' => $path . '/', |
|
151 | + 'Key' => $path.'/', |
|
152 | 152 | 'Body' => '', |
153 | 153 | 'ContentType' => 'httpd/unix-directory' |
154 | 154 | )); |
@@ -191,12 +191,12 @@ discard block |
||
191 | 191 | return false; |
192 | 192 | } |
193 | 193 | |
194 | - private function batchDelete ($path = null) { |
|
194 | + private function batchDelete($path = null) { |
|
195 | 195 | $params = array( |
196 | 196 | 'Bucket' => $this->bucket |
197 | 197 | ); |
198 | 198 | if ($path !== null) { |
199 | - $params['Prefix'] = $path . '/'; |
|
199 | + $params['Prefix'] = $path.'/'; |
|
200 | 200 | } |
201 | 201 | try { |
202 | 202 | // Since there are no real directories on S3, we need |
@@ -279,7 +279,7 @@ discard block |
||
279 | 279 | $stat['atime'] = time(); |
280 | 280 | |
281 | 281 | return $stat; |
282 | - } catch(S3Exception $e) { |
|
282 | + } catch (S3Exception $e) { |
|
283 | 283 | \OCP\Util::logException('files_external', $e); |
284 | 284 | return false; |
285 | 285 | } |
@@ -394,14 +394,14 @@ discard block |
||
394 | 394 | $fileType = $this->filetype($path); |
395 | 395 | try { |
396 | 396 | if ($fileType !== false) { |
397 | - if ($fileType === 'dir' && ! $this->isRoot($path)) { |
|
397 | + if ($fileType === 'dir' && !$this->isRoot($path)) { |
|
398 | 398 | $path .= '/'; |
399 | 399 | } |
400 | 400 | $this->getConnection()->copyObject([ |
401 | 401 | 'Bucket' => $this->bucket, |
402 | 402 | 'Key' => $this->cleanKey($path), |
403 | 403 | 'Metadata' => $metadata, |
404 | - 'CopySource' => $this->bucket . '/' . $path, |
|
404 | + 'CopySource' => $this->bucket.'/'.$path, |
|
405 | 405 | 'MetadataDirective' => 'REPLACE', |
406 | 406 | ]); |
407 | 407 | $this->testTimeout(); |
@@ -434,7 +434,7 @@ discard block |
||
434 | 434 | $this->getConnection()->copyObject(array( |
435 | 435 | 'Bucket' => $this->bucket, |
436 | 436 | 'Key' => $this->cleanKey($path2), |
437 | - 'CopySource' => S3Client::encodeKey($this->bucket . '/' . $path1) |
|
437 | + 'CopySource' => S3Client::encodeKey($this->bucket.'/'.$path1) |
|
438 | 438 | )); |
439 | 439 | $this->testTimeout(); |
440 | 440 | } catch (S3Exception $e) { |
@@ -447,8 +447,8 @@ discard block |
||
447 | 447 | try { |
448 | 448 | $this->getConnection()->copyObject(array( |
449 | 449 | 'Bucket' => $this->bucket, |
450 | - 'Key' => $path2 . '/', |
|
451 | - 'CopySource' => S3Client::encodeKey($this->bucket . '/' . $path1 . '/') |
|
450 | + 'Key' => $path2.'/', |
|
451 | + 'CopySource' => S3Client::encodeKey($this->bucket.'/'.$path1.'/') |
|
452 | 452 | )); |
453 | 453 | $this->testTimeout(); |
454 | 454 | } catch (S3Exception $e) { |
@@ -463,8 +463,8 @@ discard block |
||
463 | 463 | continue; |
464 | 464 | } |
465 | 465 | |
466 | - $source = $path1 . '/' . $file; |
|
467 | - $target = $path2 . '/' . $file; |
|
466 | + $source = $path1.'/'.$file; |
|
467 | + $target = $path2.'/'.$file; |
|
468 | 468 | $this->copy($source, $target); |
469 | 469 | } |
470 | 470 | } |
@@ -51,7 +51,7 @@ |
||
51 | 51 | * @throws InsufficientDataForMeaningfulAnswerException |
52 | 52 | * @throws StorageNotAvailableException |
53 | 53 | */ |
54 | - public function manipulateStorageConfig(StorageConfig &$storage, IUser $user = null) { |
|
54 | + public function manipulateStorageConfig(StorageConfig & $storage, IUser $user = null) { |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | /** |