Code Duplication    Length = 11-11 lines in 2 locations

src/Phinx/Db/Adapter/MysqlAdapter.php 1 location

@@ 365-375 (lines=11) @@
362
    /**
363
     * {@inheritdoc}
364
     */
365
    public function hasColumn($tableName, $columnName)
366
    {
367
        $rows = $this->fetchAll(sprintf('SHOW COLUMNS FROM %s', $this->quoteTableName($tableName)));
368
        foreach ($rows as $column) {
369
            if (strcasecmp($column['Field'], $columnName) === 0) {
370
                return true;
371
            }
372
        }
373
374
        return false;
375
    }
376
377
    /**
378
     * Get the defintion for a `DEFAULT` statement.

src/Phinx/Db/Adapter/SQLiteAdapter.php 1 location

@@ 294-304 (lines=11) @@
291
    /**
292
     * {@inheritdoc}
293
     */
294
    public function hasColumn($tableName, $columnName)
295
    {
296
        $rows = $this->fetchAll(sprintf('pragma table_info(%s)', $this->quoteTableName($tableName)));
297
        foreach ($rows as $column) {
298
            if (strcasecmp($column['name'], $columnName) === 0) {
299
                return true;
300
            }
301
        }
302
303
        return false;
304
    }
305
306
    /**
307
     * {@inheritdoc}