diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2020-03-26 09:30:18 +0100 |
---|---|---|
committer | Christoph Wurst <christoph@winzerhof-wurst.at> | 2020-03-26 16:34:56 +0100 |
commit | b80ebc96748b45fd2e0ba9323308657c4b00b7ec (patch) | |
tree | ec20e0ffa2f86b9b54939a83a785407319f94559 /apps/files/ajax | |
parent | 62403d0932be7d620c7bdadc6b4e13eb496fcd6f (diff) | |
download | nextcloud-server-b80ebc96748b45fd2e0ba9323308657c4b00b7ec.tar.gz nextcloud-server-b80ebc96748b45fd2e0ba9323308657c4b00b7ec.zip |
Use the short array syntax, everywhere
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'apps/files/ajax')
-rw-r--r-- | apps/files/ajax/download.php | 4 | ||||
-rw-r--r-- | apps/files/ajax/list.php | 20 |
2 files changed, 12 insertions, 12 deletions
diff --git a/apps/files/ajax/download.php b/apps/files/ajax/download.php index 5b29175a83c..d5ea0f634f2 100644 --- a/apps/files/ajax/download.php +++ b/apps/files/ajax/download.php @@ -38,7 +38,7 @@ $dir = isset($_GET['dir']) ? (string)$_GET['dir'] : ''; $files_list = json_decode($files); // in case we get only a single file if (!is_array($files_list)) { - $files_list = array($files); + $files_list = [$files]; } /** @@ -52,7 +52,7 @@ if(isset($_GET['downloadStartSecret']) setcookie('ocDownloadStarted', $_GET['downloadStartSecret'], time() + 20, '/'); } -$server_params = array( 'head' => \OC::$server->getRequest()->getMethod() === 'HEAD' ); +$server_params = [ 'head' => \OC::$server->getRequest()->getMethod() === 'HEAD' ]; /** * Http range requests support diff --git a/apps/files/ajax/list.php b/apps/files/ajax/list.php index 0b66ed10897..8cbe5841aaf 100644 --- a/apps/files/ajax/list.php +++ b/apps/files/ajax/list.php @@ -43,7 +43,7 @@ try { exit(); } - $data = array(); + $data = []; $baseUrl = \OC::$server->getURLGenerator()->linkTo('files', 'index.php') . '?dir='; $permissions = $dirInfo->getPermissions(); @@ -80,7 +80,7 @@ try { $data['files'] = \OCA\Files\Helper::formatFileInfos($files); $data['permissions'] = $permissions; - \OC_JSON::success(array('data' => $data)); + \OC_JSON::success(['data' => $data]); } catch (\OCP\Files\StorageNotAvailableException $e) { \OC::$server->getLogger()->logException($e, ['app' => 'files']); \OC_JSON::error([ @@ -91,18 +91,18 @@ try { ]); } catch (\OCP\Files\StorageInvalidException $e) { \OC::$server->getLogger()->logException($e, ['app' => 'files']); - \OC_JSON::error(array( - 'data' => array( + \OC_JSON::error([ + 'data' => [ 'exception' => StorageInvalidException::class, 'message' => $l->t('Storage invalid') - ) - )); + ] + ]); } catch (\Exception $e) { \OC::$server->getLogger()->logException($e, ['app' => 'files']); - \OC_JSON::error(array( - 'data' => array( + \OC_JSON::error([ + 'data' => [ 'exception' => \Exception::class, 'message' => $l->t('Unknown error') - ) - )); + ] + ]); } |