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