summaryrefslogtreecommitdiffstats
path: root/core/Controller
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2020-03-26 09:30:18 +0100
committerChristoph Wurst <christoph@winzerhof-wurst.at>2020-03-26 16:34:56 +0100
commitb80ebc96748b45fd2e0ba9323308657c4b00b7ec (patch)
treeec20e0ffa2f86b9b54939a83a785407319f94559 /core/Controller
parent62403d0932be7d620c7bdadc6b4e13eb496fcd6f (diff)
downloadnextcloud-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 'core/Controller')
-rw-r--r--core/Controller/LostController.php14
-rw-r--r--core/Controller/OCSController.php4
-rw-r--r--core/Controller/SetupController.php8
-rw-r--r--core/Controller/UserController.php6
4 files changed, 16 insertions, 16 deletions
diff --git a/core/Controller/LostController.php b/core/Controller/LostController.php
index e8d9b8675b6..cdeec469e04 100644
--- a/core/Controller/LostController.php
+++ b/core/Controller/LostController.php
@@ -170,7 +170,7 @@ class LostController extends Controller {
} catch (\Exception $e) {
return new TemplateResponse(
'core', 'error', [
- "errors" => array(array("error" => $e->getMessage()))
+ "errors" => [["error" => $e->getMessage()]]
],
'guest'
);
@@ -231,8 +231,8 @@ class LostController extends Controller {
* @param array $additional
* @return array
*/
- private function error($message, array $additional=array()) {
- return array_merge(array('status' => 'error', 'msg' => $message), $additional);
+ private function error($message, array $additional=[]) {
+ return array_merge(['status' => 'error', 'msg' => $message], $additional);
}
/**
@@ -297,7 +297,7 @@ class LostController extends Controller {
$instance = call_user_func($module['callback']);
// this way we can find out whether per-user keys are used or a system wide encryption key
if ($instance->needDetailedAccessList()) {
- return $this->error('', array('encryption' => true));
+ return $this->error('', ['encryption' => true]);
}
}
}
@@ -306,13 +306,13 @@ class LostController extends Controller {
$this->checkPasswordResetToken($token, $userId);
$user = $this->userManager->get($userId);
- \OC_Hook::emit('\OC\Core\LostPassword\Controller\LostController', 'pre_passwordReset', array('uid' => $userId, 'password' => $password));
+ \OC_Hook::emit('\OC\Core\LostPassword\Controller\LostController', 'pre_passwordReset', ['uid' => $userId, 'password' => $password]);
if (!$user->setPassword($password)) {
throw new \Exception();
}
- \OC_Hook::emit('\OC\Core\LostPassword\Controller\LostController', 'post_passwordReset', array('uid' => $userId, 'password' => $password));
+ \OC_Hook::emit('\OC\Core\LostPassword\Controller\LostController', 'post_passwordReset', ['uid' => $userId, 'password' => $password]);
$this->twoFactorManager->clearTwoFactorPending($userId);
@@ -354,7 +354,7 @@ class LostController extends Controller {
$encryptedValue = $this->crypto->encrypt($tokenValue, $email . $this->config->getSystemValue('secret'));
$this->config->setUserValue($user->getUID(), 'core', 'lostpassword', $encryptedValue);
- $link = $this->urlGenerator->linkToRouteAbsolute('core.lost.resetform', array('userId' => $user->getUID(), 'token' => $token));
+ $link = $this->urlGenerator->linkToRouteAbsolute('core.lost.resetform', ['userId' => $user->getUID(), 'token' => $token]);
$emailTemplate = $this->mailer->createEMailTemplate('core.ResetPassword', [
'link' => $link,
diff --git a/core/Controller/OCSController.php b/core/Controller/OCSController.php
index 664909b0fb9..60ea12f017c 100644
--- a/core/Controller/OCSController.php
+++ b/core/Controller/OCSController.php
@@ -92,14 +92,14 @@ class OCSController extends \OCP\AppFramework\OCSController {
public function getCapabilities() {
$result = [];
list($major, $minor, $micro) = \OCP\Util::getVersion();
- $result['version'] = array(
+ $result['version'] = [
'major' => $major,
'minor' => $minor,
'micro' => $micro,
'string' => \OC_Util::getVersionString(),
'edition' => '',
'extendedSupport' => \OCP\Util::hasExtendedSupport()
- );
+ ];
if($this->userSession->isLoggedIn()) {
$result['capabilities'] = $this->capabilitiesManager->getCapabilities();
diff --git a/core/Controller/SetupController.php b/core/Controller/SetupController.php
index 302edccf7a6..0135e01f148 100644
--- a/core/Controller/SetupController.php
+++ b/core/Controller/SetupController.php
@@ -74,7 +74,7 @@ class SetupController {
if(isset($post['install']) AND $post['install']=='true') {
// We have to launch the installation process :
$e = $this->setupHelper->install($post);
- $errors = array('errors' => $e);
+ $errors = ['errors' => $e];
if(count($e) > 0) {
$options = array_merge($opts, $post, $errors);
@@ -93,7 +93,7 @@ class SetupController {
}
public function display($post) {
- $defaults = array(
+ $defaults = [
'adminlogin' => '',
'adminpass' => '',
'dbuser' => '',
@@ -102,7 +102,7 @@ class SetupController {
'dbtablespace' => '',
'dbhost' => 'localhost',
'dbtype' => '',
- );
+ ];
$parameters = array_merge($defaults, $post);
\OC_Util::addScript('setup');
@@ -133,7 +133,7 @@ class SetupController {
public function loadAutoConfig($post) {
if( file_exists($this->autoConfigFile)) {
\OCP\Util::writeLog('core', 'Autoconfig file found, setting up Nextcloud…', ILogger::INFO);
- $AUTOCONFIG = array();
+ $AUTOCONFIG = [];
include $this->autoConfigFile;
$post = array_merge ($post, $AUTOCONFIG);
}
diff --git a/core/Controller/UserController.php b/core/Controller/UserController.php
index 23b2eda4e26..54c5202a59f 100644
--- a/core/Controller/UserController.php
+++ b/core/Controller/UserController.php
@@ -53,7 +53,7 @@ class UserController extends Controller {
* @return JSONResponse
*/
public function getDisplayNames($users) {
- $result = array();
+ $result = [];
foreach ($users as $user) {
$userObject = $this->userManager->get($user);
@@ -64,10 +64,10 @@ class UserController extends Controller {
}
}
- $json = array(
+ $json = [
'users' => $result,
'status' => 'success'
- );
+ ];
return new JSONResponse($json);