dsn = "mysql:host=" . getenv("SMDB_HOST") . ";dbname=" . getenv("SMDB_DATABASE") . ";charset=UTF8"; $this->login = getenv("SMDB_USER"); $this->password = getenv("SMDB_PASSWORD"); } public function connect(): int|Connection { try { $connection = new Connection($this->dsn, $this->login, $this->password); } catch (PDOException $e) { throw new PDOException($e->getMessage(), $e->getCode(), $e); } return $connection; } }