Code Duplication    Length = 14-14 lines in 2 locations

src/Database/AbstractDatabase.php 1 location

@@ 125-138 (lines=14) @@
122
        $this->setVersion($currentVersion, Migration::VERSION_STATUS_UNKNOWN);
123
    }
124
125
    protected function isTableExists($schema, $table)
126
    {
127
        $count = $this->getDbDriver()->getScalar(
128
            'SELECT count(*) FROM information_schema.tables ' .
129
            ' WHERE table_schema = [[schema]] ' .
130
            '  AND table_name = [[table]] ',
131
            [
132
                "schema" => $schema,
133
                "table" => $table
134
            ]
135
        );
136
137
        return (intval($count) !== 0);
138
    }
139
140
    public function isDatabaseVersioned()
141
    {

src/Database/DblibDatabase.php 1 location

@@ 87-100 (lines=14) @@
84
     * @param $table
85
     * @return bool
86
     */
87
    protected function isTableExists($schema, $table)
88
    {
89
        $count = $this->getDbDriver()->getScalar(
90
            'SELECT count(*) FROM information_schema.tables ' .
91
            ' WHERE table_catalog = [[schema]] ' .
92
            '  AND table_name = [[table]] ',
93
            [
94
                "schema" => $schema,
95
                "table" => $table
96
            ]
97
        );
98
99
        return (intval($count) !== 0);
100
    }
101
}
102