public static function getInstance(Configurator $configurator = null): self
    {
        if (self::$instance === null) {
            if ($configurator === null) {
                throw new DatabaseException('Configurator Missing');
            }
            self::$instance = new self($configurator);
        } elseif ($configurator !== null) {
            throw new DatabaseException('Configurator Already Setup');
        }

        return self::$instance;
    }
public static function getInstance(Configurator $configurator = null): self
    {
        if (self::$instance === null) {
            if ($configurator === null) {
                throw new DatabaseException('Configurator Missing');
            }
            self::$instance = new self($configurator);
        } elseif ($configurator !== null) {
            throw new DatabaseException('Configurator Already Setup');
        }

        return self::$instance;
    }
@param Configurator|null $configurator

@throws DatabaseException

@return Database