From b80ebc96748b45fd2e0ba9323308657c4b00b7ec Mon Sep 17 00:00:00 2001 From: Christoph Wurst Date: Thu, 26 Mar 2020 09:30:18 +0100 Subject: Use the short array syntax, everywhere Signed-off-by: Christoph Wurst --- lib/private/Setup/AbstractDatabase.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'lib/private/Setup/AbstractDatabase.php') 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)) { -- cgit v1.2.3