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/Setup | |
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/Setup')
-rw-r--r-- | lib/private/Setup/AbstractDatabase.php | 14 | ||||
-rw-r--r-- | lib/private/Setup/OCI.php | 10 | ||||
-rw-r--r-- | lib/private/Setup/Sqlite.php | 2 |
3 files changed, 13 insertions, 13 deletions
diff --git a/lib/private/Setup/AbstractDatabase.php b/lib/private/Setup/AbstractDatabase.php index d52aaa8882d..c3c873f2d8b 100644 --- a/lib/private/Setup/AbstractDatabase.php +++ b/lib/private/Setup/AbstractDatabase.php @@ -67,16 +67,16 @@ abstract class AbstractDatabase { } public function validate($config) { - $errors = array(); + $errors = []; if(empty($config['dbuser']) && empty($config['dbname'])) { - $errors[] = $this->trans->t("%s enter the database username and name.", array($this->dbprettyname)); + $errors[] = $this->trans->t("%s enter the database username and name.", [$this->dbprettyname]); } else if(empty($config['dbuser'])) { - $errors[] = $this->trans->t("%s enter the database username.", array($this->dbprettyname)); + $errors[] = $this->trans->t("%s enter the database username.", [$this->dbprettyname]); } else if(empty($config['dbname'])) { - $errors[] = $this->trans->t("%s enter the database name.", array($this->dbprettyname)); + $errors[] = $this->trans->t("%s enter the database name.", [$this->dbprettyname]); } if(substr_count($config['dbname'], '.') >= 1) { - $errors[] = $this->trans->t("%s you may not use dots in the database name", array($this->dbprettyname)); + $errors[] = $this->trans->t("%s you may not use dots in the database name", [$this->dbprettyname]); } return $errors; } @@ -109,13 +109,13 @@ abstract class AbstractDatabase { * @return \OC\DB\Connection */ protected function connect(array $configOverwrite = []) { - $connectionParams = array( + $connectionParams = [ 'host' => $this->dbHost, 'user' => $this->dbUser, 'password' => $this->dbPassword, 'tablePrefix' => $this->tablePrefix, 'dbname' => $this->dbName - ); + ]; // adding port support through installer if (!empty($this->dbPort)) { diff --git a/lib/private/Setup/OCI.php b/lib/private/Setup/OCI.php index 75d75254a00..f1dcf6c3b5d 100644 --- a/lib/private/Setup/OCI.php +++ b/lib/private/Setup/OCI.php @@ -52,13 +52,13 @@ class OCI extends AbstractDatabase { } public function validate($config) { - $errors = array(); + $errors = []; if (empty($config['dbuser']) && empty($config['dbname'])) { - $errors[] = $this->trans->t("%s enter the database username and name.", array($this->dbprettyname)); + $errors[] = $this->trans->t("%s enter the database username and name.", [$this->dbprettyname]); } else if (empty($config['dbuser'])) { - $errors[] = $this->trans->t("%s enter the database username.", array($this->dbprettyname)); + $errors[] = $this->trans->t("%s enter the database username.", [$this->dbprettyname]); } else if (empty($config['dbname'])) { - $errors[] = $this->trans->t("%s enter the database name.", array($this->dbprettyname)); + $errors[] = $this->trans->t("%s enter the database name.", [$this->dbprettyname]); } return $errors; } @@ -101,7 +101,7 @@ class OCI extends AbstractDatabase { } else { $error = oci_error(); } - foreach (array('message', 'code') as $key) { + foreach (['message', 'code'] as $key) { if (isset($error[$key])) { return $error[$key]; } diff --git a/lib/private/Setup/Sqlite.php b/lib/private/Setup/Sqlite.php index 0b97b4c0451..9bb482229ef 100644 --- a/lib/private/Setup/Sqlite.php +++ b/lib/private/Setup/Sqlite.php @@ -29,7 +29,7 @@ class Sqlite extends AbstractDatabase { public $dbprettyname = 'Sqlite'; public function validate($config) { - return array(); + return []; } public function initialize($config) { |