diff options
Diffstat (limited to 'apps/files_sharing/lib')
-rw-r--r-- | apps/files_sharing/lib/Controller/ShareController.php | 2 | ||||
-rw-r--r-- | apps/files_sharing/lib/External/Manager.php | 26 | ||||
-rw-r--r-- | apps/files_sharing/lib/External/Storage.php | 4 | ||||
-rw-r--r-- | apps/files_sharing/lib/ShareBackend/File.php | 20 | ||||
-rw-r--r-- | apps/files_sharing/lib/ShareBackend/Folder.php | 10 | ||||
-rw-r--r-- | apps/files_sharing/lib/SharedStorage.php | 4 |
6 files changed, 33 insertions, 33 deletions
diff --git a/apps/files_sharing/lib/Controller/ShareController.php b/apps/files_sharing/lib/Controller/ShareController.php index 620aaf42c69..1022788ed2f 100644 --- a/apps/files_sharing/lib/Controller/ShareController.php +++ b/apps/files_sharing/lib/Controller/ShareController.php @@ -615,7 +615,7 @@ class ShareController extends AuthPublicShareController { $this->emitAccessShareHook($share); - $server_params = array( 'head' => $this->request->getMethod() === 'HEAD' ); + $server_params = [ 'head' => $this->request->getMethod() === 'HEAD' ]; /** * Http range requests support diff --git a/apps/files_sharing/lib/External/Manager.php b/apps/files_sharing/lib/External/Manager.php index c58e6e7b98a..c89bb2c2f4f 100644 --- a/apps/files_sharing/lib/External/Manager.php +++ b/apps/files_sharing/lib/External/Manager.php @@ -193,13 +193,13 @@ class Manager { $this->writeShareToDb($remote, $token, $password, $name, $owner, $user, $mountPoint, $hash, $accepted, $remoteId, $parent, $shareType); - $options = array( + $options = [ 'remote' => $remote, 'token' => $token, 'password' => $password, 'mountpoint' => $mountPoint, 'owner' => $owner - ); + ]; return $this->mountShare($options); } @@ -226,7 +226,7 @@ class Manager { (`remote`, `share_token`, `password`, `name`, `owner`, `user`, `mountpoint`, `mountpoint_hash`, `accepted`, `remote_id`, `parent`, `share_type`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) '); - return $query->execute(array($remote, $token, $password, $name, $owner, $user, $mountPoint, $hash, $accepted, $remoteId, $parent, $shareType)); + return $query->execute([$remote, $token, $password, $name, $owner, $user, $mountPoint, $hash, $accepted, $remoteId, $parent, $shareType]); } /** @@ -240,7 +240,7 @@ class Manager { SELECT `id`, `remote`, `remote_id`, `share_token`, `name`, `owner`, `user`, `mountpoint`, `accepted`, `parent`, `share_type`, `password`, `mountpoint_hash` FROM `*PREFIX*share_external` WHERE `id` = ?'); - $result = $getShare->execute(array($id)); + $result = $getShare->execute([$id]); $share = $result ? $getShare->fetch() : []; @@ -286,7 +286,7 @@ class Manager { `mountpoint` = ?, `mountpoint_hash` = ? WHERE `id` = ? AND `user` = ?'); - $userShareAccepted = $acceptShare->execute(array(1, $mountPoint, $hash, $id, $this->uid)); + $userShareAccepted = $acceptShare->execute([1, $mountPoint, $hash, $id, $this->uid]); } else { $result = $this->writeShareToDb( $share['remote'], @@ -327,7 +327,7 @@ class Manager { if ($share && (int)$share['share_type'] === Share::SHARE_TYPE_USER) { $removeShare = $this->connection->prepare(' DELETE FROM `*PREFIX*share_external` WHERE `id` = ? AND `user` = ?'); - $removeShare->execute(array($id, $this->uid)); + $removeShare->execute([$id, $this->uid]); $this->sendFeedbackToRemote($share['remote'], $share['share_token'], $share['remote_id'], 'decline'); $this->processNotification($id); @@ -384,7 +384,7 @@ class Manager { $endpoint = isset($federationEndpoints['share']) ? $federationEndpoints['share'] : '/ocs/v2.php/cloud/shares'; $url = rtrim($remote, '/') . $endpoint . '/' . $remoteId . '/' . $feedback . '?format=' . Share::RESPONSE_FORMAT; - $fields = array('token' => $token); + $fields = ['token' => $token]; $client = $this->clientService->newClient(); @@ -502,7 +502,7 @@ class Manager { WHERE `mountpoint_hash` = ? AND `user` = ? '); - $result = (bool)$query->execute(array($target, $targetHash, $sourceHash, $this->uid)); + $result = (bool)$query->execute([$target, $targetHash, $sourceHash, $this->uid]); return $result; } @@ -519,7 +519,7 @@ class Manager { SELECT `remote`, `share_token`, `remote_id`, `share_type`, `id` FROM `*PREFIX*share_external` WHERE `mountpoint_hash` = ? AND `user` = ?'); - $result = $getShare->execute(array($hash, $this->uid)); + $result = $getShare->execute([$hash, $this->uid]); $share = $getShare->fetch(); $getShare->closeCursor(); @@ -535,13 +535,13 @@ class Manager { DELETE FROM `*PREFIX*share_external` WHERE `id` = ? '); - $result = (bool)$query->execute(array((int)$share['id'])); + $result = (bool)$query->execute([(int)$share['id']]); } else if ($result && (int)$share['share_type'] === Share::SHARE_TYPE_GROUP) { $query = $this->connection->prepare(' UPDATE `*PREFIX*share_external` SET `accepted` = ? WHERE `id` = ?'); - $result = (bool)$query->execute(array(0, (int)$share['id'])); + $result = (bool)$query->execute([0, (int)$share['id']]); } if($result) { @@ -585,7 +585,7 @@ class Manager { SELECT `remote`, `share_token`, `remote_id` FROM `*PREFIX*share_external` WHERE `user` = ?'); - $result = $getShare->execute(array($uid)); + $result = $getShare->execute([$uid]); if ($result) { $shares = $getShare->fetchAll(); @@ -598,7 +598,7 @@ class Manager { DELETE FROM `*PREFIX*share_external` WHERE `user` = ? '); - return (bool)$query->execute(array($uid)); + return (bool)$query->execute([$uid]); } /** diff --git a/apps/files_sharing/lib/External/Storage.php b/apps/files_sharing/lib/External/Storage.php index 97870f73343..e405d8c4472 100644 --- a/apps/files_sharing/lib/External/Storage.php +++ b/apps/files_sharing/lib/External/Storage.php @@ -85,13 +85,13 @@ class Storage extends DAV implements ISharedStorage, IDisableEncryptionStorage { $this->mountPoint = $options['mountpoint']; $this->token = $options['token']; - parent::__construct(array( + parent::__construct([ 'secure' => $secure, 'host' => $host, 'root' => $root, 'user' => $options['token'], 'password' => (string)$options['password'] - )); + ]); } public function getWatcher($path = '', $storage = null) { diff --git a/apps/files_sharing/lib/ShareBackend/File.php b/apps/files_sharing/lib/ShareBackend/File.php index a3a041142eb..7bde5979ce1 100644 --- a/apps/files_sharing/lib/ShareBackend/File.php +++ b/apps/files_sharing/lib/ShareBackend/File.php @@ -117,7 +117,7 @@ class File implements \OCP\Share_Backend_File_Dependent { } } - $excludeList = is_array($exclude) ? $exclude : array(); + $excludeList = is_array($exclude) ? $exclude : []; return \OCA\Files_Sharing\Helper::generateUniqueTarget($target, $excludeList, $view); } @@ -126,17 +126,17 @@ class File implements \OCP\Share_Backend_File_Dependent { if ($format === self::FORMAT_SHARED_STORAGE) { // Only 1 item should come through for this format call $item = array_shift($items); - return array( + return [ 'parent' => $item['parent'], 'path' => $item['path'], 'storage' => $item['storage'], 'permissions' => $item['permissions'], 'uid_owner' => $item['uid_owner'], - ); + ]; } else if ($format === self::FORMAT_GET_FOLDER_CONTENTS) { - $files = array(); + $files = []; foreach ($items as $item) { - $file = array(); + $file = []; $file['fileid'] = $item['file_source']; $file['storage'] = $item['storage']; $file['path'] = $item['file_target']; @@ -157,31 +157,31 @@ class File implements \OCP\Share_Backend_File_Dependent { } return $files; } else if ($format === self::FORMAT_OPENDIR) { - $files = array(); + $files = []; foreach ($items as $item) { $files[] = basename($item['file_target']); } return $files; } else if ($format === self::FORMAT_GET_ALL) { - $ids = array(); + $ids = []; foreach ($items as $item) { $ids[] = $item['file_source']; } return $ids; } else if ($format === self::FORMAT_PERMISSIONS) { - $filePermissions = array(); + $filePermissions = []; foreach ($items as $item) { $filePermissions[$item['file_source']] = $item['permissions']; } return $filePermissions; } else if ($format === self::FORMAT_TARGET_NAMES) { - $targets = array(); + $targets = []; foreach ($items as $item) { $targets[] = $item['file_target']; } return $targets; } - return array(); + return []; } /** diff --git a/apps/files_sharing/lib/ShareBackend/Folder.php b/apps/files_sharing/lib/ShareBackend/Folder.php index fd4bb2491fa..0c1ea18667c 100644 --- a/apps/files_sharing/lib/ShareBackend/Folder.php +++ b/apps/files_sharing/lib/ShareBackend/Folder.php @@ -39,7 +39,7 @@ class Folder extends File implements \OCP\Share_Backend_Collection { * @return array with shares */ public function getParents($itemSource, $shareWith = null, $owner = null) { - $result = array(); + $result = []; $parent = $this->getParentId($itemSource); $userManager = \OC::$server->getUserManager(); @@ -89,8 +89,8 @@ class Folder extends File implements \OCP\Share_Backend_Collection { } public function getChildren($itemSource) { - $children = array(); - $parents = array($itemSource); + $children = []; + $parents = [$itemSource]; $qb = \OC::$server->getDatabaseConnection()->getQueryBuilder(); $qb->select('id') @@ -123,9 +123,9 @@ class Folder extends File implements \OCP\Share_Backend_Collection { $result = $qb->execute(); - $parents = array(); + $parents = []; while ($file = $result->fetch()) { - $children[] = array('source' => $file['fileid'], 'file_path' => $file['name']); + $children[] = ['source' => $file['fileid'], 'file_path' => $file['name']]; // If a child folder is found look inside it if ((int) $file['mimetype'] === $mimetype) { $parents[] = $file['fileid']; diff --git a/apps/files_sharing/lib/SharedStorage.php b/apps/files_sharing/lib/SharedStorage.php index 0baa36ac985..ea0163e80b2 100644 --- a/apps/files_sharing/lib/SharedStorage.php +++ b/apps/files_sharing/lib/SharedStorage.php @@ -285,11 +285,11 @@ class SharedStorage extends \OC\Files\Storage\Wrapper\Jail implements ISharedSto } } } - $info = array( + $info = [ 'target' => $this->getMountPoint() . $path, 'source' => $source, 'mode' => $mode, - ); + ]; \OCP\Util::emitHook('\OC\Files\Storage\Shared', 'fopen', $info); return $this->nonMaskedStorage->fopen($this->getUnjailedPath($path), $mode); } |