Reorganize code for PSR and others code prettify.
This commit is contained in:
@ -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()
|
||||
);
|
||||
|
Reference in New Issue
Block a user