Reorganize code for PSR and others code prettify.

This commit is contained in:
KJ
2024-05-09 15:13:52 -04:00
parent 6a1085b224
commit f5f803dde2
7 changed files with 191 additions and 67 deletions

View File

@ -30,7 +30,8 @@ class Database extends PDO {
*
* @return PDO
*/
static public function getInstance() : PDO {
static public function getInstance(): PDO
{
if (is_null(self::$db)) {
if (DB_TYPE == 'sqlite') {
@ -43,7 +44,6 @@ class Database extends PDO {
try {
self::$db = new PDO($dsn, DB_USER, DB_PASS);
} catch (PDOException $e) {
echo "<pre>";
throw new Exception(
'Error at connect to database: ' . $e->getMessage()
);