Code Duplication    Length = 9-9 lines in 2 locations

src/Commands/DblibCommand.php 1 location

@@ 11-19 (lines=9) @@
8
class DblibCommand extends AbstractCommand
9
{
10
11
    public static function prepareEnvironment(Uri $uri)
12
    {
13
        $database = preg_replace('~^/~', '', $uri->getPath());
14
15
        $customUri = new Uri($uri->__toString());
16
17
        $dbDriver = Factory::getDbRelationalInstance($customUri->withPath('/')->__toString());
18
        $dbDriver->execute("IF NOT EXISTS(select * from sys.databases where name='$database') CREATE DATABASE $database");
19
    }
20
21
    public function createDatabase()
22
    {

src/Commands/MysqlCommand.php 1 location

@@ 11-19 (lines=9) @@
8
class MySqlCommand extends AbstractCommand
9
{
10
11
    public static function prepareEnvironment(Uri $uri)
12
    {
13
        $database = preg_replace('~^/~', '', $uri->getPath());
14
15
        $customUri = new Uri($uri->__toString());
16
17
        $dbDriver = Factory::getDbRelationalInstance($customUri->withPath('/')->__toString());
18
        $dbDriver->execute("CREATE SCHEMA IF NOT EXISTS `$database` DEFAULT CHARACTER SET utf8 ;");
19
    }
20
21
    public function createDatabase()
22
    {