Code Duplication    Length = 13-17 lines in 2 locations

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

@@ 478-494 (lines=17) @@
475
    /**
476
     * {@inheritdoc}
477
     */
478
    public function hasIndex($tableName, $columns)
479
    {
480
        if (is_string($columns)) {
481
            $columns = [$columns]; // str to array
482
        }
483
484
        $columns = array_map('strtolower', $columns);
485
        $indexes = $this->getIndexes($tableName);
486
487
        foreach ($indexes as $index) {
488
            if ($columns == $index['columns']) {
489
                return true;
490
            }
491
        }
492
493
        return false;
494
    }
495
496
    /**
497
     * {@inheritdoc}

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

@@ 579-591 (lines=13) @@
576
    /**
577
     * {@inheritdoc}
578
     */
579
    public function hasIndex($tableName, $columns)
580
    {
581
        if (is_string($columns)) {
582
            $columns = [$columns];
583
        }
584
        $indexes = $this->getIndexes($tableName);
585
        foreach ($indexes as $index) {
586
            if (array_diff($index['columns'], $columns) === array_diff($columns, $index['columns'])) {
587
                return true;
588
            }
589
        }
590
591
        return false;
592
    }
593
594
    /**