From 836c5dc18338dc99fdfa9d119bf3f775c67cd9cf Mon Sep 17 00:00:00 2001 From: William Date: Fri, 21 Jan 2022 21:16:14 +0100 Subject: [PATCH] Commit --- app/core/Database.php | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/app/core/Database.php b/app/core/Database.php index d3508c5..fd85524 100644 --- a/app/core/Database.php +++ b/app/core/Database.php @@ -21,16 +21,10 @@ class Database private function connectWithMySQL(array $args): object { - $host = $args['host']; - $database = $args['database']; - $charset = $args['charset']; - $user = $args['user']; - $password = $args['password']; - - $dsn = "mysql:host=$host;dbname=$database;charset=$charset"; + $dsn = "mysql:host={$args['host']};dbname={$args['database']};charset={$args['charset']}"; $options = [ PDO::ATTR_PERSISTENT => true, ]; - return new PDO($dsn, $user, $password, $options); + return new PDO($dsn, $args['user'], $args['password'], $options); } } \ No newline at end of file