Code Duplication    Length = 11-12 lines in 2 locations

source/Spiral/Database/Drivers/Postgres/PostgresDriver.php 1 location

@@ 97-108 (lines=12) @@
94
    /**
95
     * {@inheritdoc}
96
     */
97
    public function tableNames()
98
    {
99
        $query = 'SELECT "table_name" FROM "information_schema"."tables" '
100
            . 'WHERE "table_schema" = \'public\' AND "table_type" = \'BASE TABLE\'';
101
102
        $tables = [];
103
        foreach ($this->query($query) as $row) {
104
            $tables[] = $row['table_name'];
105
        }
106
107
        return $tables;
108
    }
109
110
    /**
111
     * Get singular primary key associated with desired table. Used to emulate last insert id.

source/Spiral/Database/Drivers/SQLServer/SQLServerDriver.php 1 location

@@ 102-112 (lines=11) @@
99
    /**
100
     * {@inheritdoc}
101
     */
102
    public function tableNames()
103
    {
104
        $query = "SELECT table_name FROM information_schema.tables WHERE table_type = 'BASE TABLE'";
105
106
        $tables = [];
107
        foreach ($this->query($query)->fetchMode(PDO::FETCH_NUM) as $row) {
108
            $tables[] = $row[0];
109
        }
110
111
        return $tables;
112
    }
113
114
    /**
115
     * SQLServer version.