Cleanup
This commit is contained in:
@@ -3,17 +3,28 @@
|
||||
namespace Khofmann\Database;
|
||||
|
||||
use PDO;
|
||||
use Config\Config;
|
||||
use Khofmann\Config\Config;
|
||||
use Exception;
|
||||
|
||||
class Database extends PDO
|
||||
{
|
||||
private static array $instances = [];
|
||||
|
||||
protected function __construct(string $dsn, string $username = null, string $password = null, array $options = null)
|
||||
private function __construct(string $dsn, string $username = null, string $password = null, array $options = null)
|
||||
{
|
||||
parent::__construct($dsn, $username, $password, $options);
|
||||
}
|
||||
|
||||
private function __clone()
|
||||
{
|
||||
throw new Exception("Cannot clone a singleton.");
|
||||
}
|
||||
|
||||
private function __wakeup()
|
||||
{
|
||||
throw new Exception("Cannot unserialize a singleton.");
|
||||
}
|
||||
|
||||
public static function getInstance(): Database
|
||||
{
|
||||
$cls = static::class;
|
||||
|
||||
Reference in New Issue
Block a user