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 /lib/private/User | |
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 'lib/private/User')
-rw-r--r-- | lib/private/User/Backend.php | 8 | ||||
-rw-r--r-- | lib/private/User/Manager.php | 14 | ||||
-rw-r--r-- | lib/private/User/Session.php | 8 | ||||
-rw-r--r-- | lib/private/User/User.php | 10 |
4 files changed, 20 insertions, 20 deletions
diff --git a/lib/private/User/Backend.php b/lib/private/User/Backend.php index a4dbcf77484..a616183dced 100644 --- a/lib/private/User/Backend.php +++ b/lib/private/User/Backend.php @@ -47,7 +47,7 @@ abstract class Backend implements UserInterface { const PROVIDE_AVATAR = 16777216; // 1 << 24 const COUNT_USERS = 268435456; // 1 << 28 - protected $possibleActions = array( + protected $possibleActions = [ self::CREATE_USER => 'createUser', self::SET_PASSWORD => 'setPassword', self::CHECK_PASSWORD => 'checkPassword', @@ -56,7 +56,7 @@ abstract class Backend implements UserInterface { self::SET_DISPLAYNAME => 'setDisplayName', self::PROVIDE_AVATAR => 'canChangeAvatar', self::COUNT_USERS => 'countUsers', - ); + ]; /** * Get all supported actions @@ -108,7 +108,7 @@ abstract class Backend implements UserInterface { * @return string[] an array of all uids */ public function getUsers($search = '', $limit = null, $offset = null) { - return array(); + return []; } /** @@ -147,7 +147,7 @@ abstract class Backend implements UserInterface { * @return array an array of all displayNames (value) and the corresponding uids (key) */ public function getDisplayNames($search = '', $limit = null, $offset = null) { - $displayNames = array(); + $displayNames = []; $users = $this->getUsers($search, $limit, $offset); foreach ( $users as $user) { $displayNames[$user] = $user; diff --git a/lib/private/User/Manager.php b/lib/private/User/Manager.php index 7fc774630bd..2dd12cf916d 100644 --- a/lib/private/User/Manager.php +++ b/lib/private/User/Manager.php @@ -69,12 +69,12 @@ class Manager extends PublicEmitter implements IUserManager { /** * @var \OCP\UserInterface[] $backends */ - private $backends = array(); + private $backends = []; /** * @var \OC\User\User[] $cachedUsers */ - private $cachedUsers = array(); + private $cachedUsers = []; /** @var IConfig */ private $config; @@ -121,7 +121,7 @@ class Manager extends PublicEmitter implements IUserManager { * @param \OCP\UserInterface $backend */ public function removeBackend($backend) { - $this->cachedUsers = array(); + $this->cachedUsers = []; if (($i = array_search($backend, $this->backends)) !== false) { unset($this->backends[$i]); } @@ -131,8 +131,8 @@ class Manager extends PublicEmitter implements IUserManager { * remove all user backends */ public function clearBackends() { - $this->cachedUsers = array(); - $this->backends = array(); + $this->cachedUsers = []; + $this->backends = []; } /** @@ -241,7 +241,7 @@ class Manager extends PublicEmitter implements IUserManager { * @return \OC\User\User[] */ public function search($pattern, $limit = null, $offset = null) { - $users = array(); + $users = []; foreach ($this->backends as $backend) { $backendUsers = $backend->getUsers($pattern, $limit, $offset); if (is_array($backendUsers)) { @@ -270,7 +270,7 @@ class Manager extends PublicEmitter implements IUserManager { * @return \OC\User\User[] */ public function searchDisplayName($pattern, $limit = null, $offset = null) { - $users = array(); + $users = []; foreach ($this->backends as $backend) { $backendUsers = $backend->getDisplayNames($pattern, $limit, $offset); if (is_array($backendUsers)) { diff --git a/lib/private/User/Session.php b/lib/private/User/Session.php index 602f779c901..3d97ddce7f9 100644 --- a/lib/private/User/Session.php +++ b/lib/private/User/Session.php @@ -440,7 +440,7 @@ class Session implements IUserSession, Emitter { $currentDelay = $throttler->sleepDelay($request->getRemoteAddress(), 'login'); if ($this->manager instanceof PublicEmitter) { - $this->manager->emit('\OC\User', 'preLogin', array($user, $password)); + $this->manager->emit('\OC\User', 'preLogin', [$user, $password]); } try { @@ -500,7 +500,7 @@ class Session implements IUserSession, Emitter { Util::emitHook( '\OCA\Files_Sharing\API\Server2Server', 'preLoginNameUsedAsUserName', - array('uid' => &$username) + ['uid' => &$username] ); $user = $this->manager->get($username); if (is_null($user)) { @@ -640,7 +640,7 @@ class Session implements IUserSession, Emitter { // Ignore and use empty string instead } - $this->manager->emit('\OC\User', 'preLogin', array($uid, $password)); + $this->manager->emit('\OC\User', 'preLogin', [$uid, $password]); $user = $this->manager->get($uid); if (is_null($user)) { @@ -841,7 +841,7 @@ class Session implements IUserSession, Emitter { */ public function loginWithCookie($uid, $currentToken, $oldSessionId) { $this->session->regenerateId(); - $this->manager->emit('\OC\User', 'preRememberedLogin', array($uid)); + $this->manager->emit('\OC\User', 'preRememberedLogin', [$uid]); $user = $this->manager->get($uid); if (is_null($user)) { // user does not exist diff --git a/lib/private/User/User.php b/lib/private/User/User.php index c68b8b88e31..d3ad6dd5799 100644 --- a/lib/private/User/User.php +++ b/lib/private/User/User.php @@ -202,7 +202,7 @@ class User implements IUser { public function delete() { $this->dispatcher->dispatch(IUser::class . '::preDelete', new GenericEvent($this)); if ($this->emitter) { - $this->emitter->emit('\OC\User', 'preDelete', array($this)); + $this->emitter->emit('\OC\User', 'preDelete', [$this]); } // get the home now because it won't return it after user deletion $homePath = $this->getHome(); @@ -247,7 +247,7 @@ class User implements IUser { $this->dispatcher->dispatch(IUser::class . '::postDelete', new GenericEvent($this)); if ($this->emitter) { - $this->emitter->emit('\OC\User', 'postDelete', array($this)); + $this->emitter->emit('\OC\User', 'postDelete', [$this]); } } return !($result === false); @@ -266,7 +266,7 @@ class User implements IUser { 'recoveryPassword' => $recoveryPassword, ])); if ($this->emitter) { - $this->emitter->emit('\OC\User', 'preSetPassword', array($this, $password, $recoveryPassword)); + $this->emitter->emit('\OC\User', 'preSetPassword', [$this, $password, $recoveryPassword]); } if ($this->backend->implementsActions(Backend::SET_PASSWORD)) { $result = $this->backend->setPassword($this->uid, $password); @@ -275,7 +275,7 @@ class User implements IUser { 'recoveryPassword' => $recoveryPassword, ])); if ($this->emitter) { - $this->emitter->emit('\OC\User', 'postSetPassword', array($this, $password, $recoveryPassword)); + $this->emitter->emit('\OC\User', 'postSetPassword', [$this, $password, $recoveryPassword]); } return !($result === false); } else { @@ -473,7 +473,7 @@ class User implements IUser { 'oldValue' => $oldValue, ])); if ($this->emitter) { - $this->emitter->emit('\OC\User', 'changeUser', array($this, $feature, $value, $oldValue)); + $this->emitter->emit('\OC\User', 'changeUser', [$this, $feature, $value, $oldValue]); } } } |