summaryrefslogtreecommitdiffstats
path: root/lib/private/AllConfig.php
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 /lib/private/AllConfig.php
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 'lib/private/AllConfig.php')
-rw-r--r--lib/private/AllConfig.php30
1 files changed, 15 insertions, 15 deletions
diff --git a/lib/private/AllConfig.php b/lib/private/AllConfig.php
index 2eca9d55b28..0111fad246f 100644
--- a/lib/private/AllConfig.php
+++ b/lib/private/AllConfig.php
@@ -297,7 +297,7 @@ class AllConfig implements \OCP\IConfig {
// only add to the cache if we already loaded data for the user
if (isset($this->userCache[$userId])) {
if (!isset($this->userCache[$userId][$appName])) {
- $this->userCache[$userId][$appName] = array();
+ $this->userCache[$userId][$appName] = [];
}
$this->userCache[$userId][$appName][$key] = (string)$value;
}
@@ -333,7 +333,7 @@ class AllConfig implements \OCP\IConfig {
if (isset($data[$appName])) {
return array_keys($data[$appName]);
} else {
- return array();
+ return [];
}
}
@@ -350,7 +350,7 @@ class AllConfig implements \OCP\IConfig {
$sql = 'DELETE FROM `*PREFIX*preferences` '.
'WHERE `userid` = ? AND `appid` = ? AND `configkey` = ?';
- $this->connection->executeUpdate($sql, array($userId, $appName, $key));
+ $this->connection->executeUpdate($sql, [$userId, $appName, $key]);
if (isset($this->userCache[$userId]) and isset($this->userCache[$userId][$appName])) {
unset($this->userCache[$userId][$appName][$key]);
@@ -368,7 +368,7 @@ class AllConfig implements \OCP\IConfig {
$sql = 'DELETE FROM `*PREFIX*preferences` '.
'WHERE `userid` = ?';
- $this->connection->executeUpdate($sql, array($userId));
+ $this->connection->executeUpdate($sql, [$userId]);
unset($this->userCache[$userId]);
}
@@ -384,7 +384,7 @@ class AllConfig implements \OCP\IConfig {
$sql = 'DELETE FROM `*PREFIX*preferences` '.
'WHERE `appid` = ?';
- $this->connection->executeUpdate($sql, array($appName));
+ $this->connection->executeUpdate($sql, [$appName]);
foreach ($this->userCache as &$userCache) {
unset($userCache[$appName]);
@@ -405,20 +405,20 @@ class AllConfig implements \OCP\IConfig {
return $this->userCache[$userId];
}
if ($userId === null || $userId === '') {
- $this->userCache[$userId]=array();
+ $this->userCache[$userId]=[];
return $this->userCache[$userId];
}
// TODO - FIXME
$this->fixDIInit();
- $data = array();
+ $data = [];
$query = 'SELECT `appid`, `configkey`, `configvalue` FROM `*PREFIX*preferences` WHERE `userid` = ?';
- $result = $this->connection->executeQuery($query, array($userId));
+ $result = $this->connection->executeQuery($query, [$userId]);
while ($row = $result->fetch()) {
$appId = $row['appid'];
if (!isset($data[$appId])) {
- $data[$appId] = array();
+ $data[$appId] = [];
}
$data[$appId][$row['configkey']] = $row['configvalue'];
}
@@ -439,13 +439,13 @@ class AllConfig implements \OCP\IConfig {
$this->fixDIInit();
if (empty($userIds) || !is_array($userIds)) {
- return array();
+ return [];
}
$chunkedUsers = array_chunk($userIds, 50, true);
$placeholders50 = implode(',', array_fill(0, 50, '?'));
- $userValues = array();
+ $userValues = [];
foreach ($chunkedUsers as $chunk) {
$queryParams = $chunk;
// create [$app, $key, $chunkedUsers]
@@ -490,9 +490,9 @@ class AllConfig implements \OCP\IConfig {
$sql .= 'AND `configvalue` = ?';
}
- $result = $this->connection->executeQuery($sql, array($appName, $key, $value));
+ $result = $this->connection->executeQuery($sql, [$appName, $key, $value]);
- $userIDs = array();
+ $userIDs = [];
while ($row = $result->fetch()) {
$userIDs[] = $row['userid'];
}
@@ -522,9 +522,9 @@ class AllConfig implements \OCP\IConfig {
$sql .= 'AND LOWER(`configvalue`) = LOWER(?)';
}
- $result = $this->connection->executeQuery($sql, array($appName, $key, $value));
+ $result = $this->connection->executeQuery($sql, [$appName, $key, $value]);
- $userIDs = array();
+ $userIDs = [];
while ($row = $result->fetch()) {
$userIDs[] = $row['userid'];
}