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

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