Code Duplication    Length = 13-17 lines in 2 locations

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

@@ 486-502 (lines=17) @@
483
    /**
484
     * {@inheritdoc}
485
     */
486
    public function hasIndex($tableName, $columns)
487
    {
488
        if (is_string($columns)) {
489
            $columns = [$columns]; // str to array
490
        }
491
492
        $columns = array_map('strtolower', $columns);
493
        $indexes = $this->getIndexes($tableName);
494
495
        foreach ($indexes as $index) {
496
            if ($columns == $index['columns']) {
497
                return true;
498
            }
499
        }
500
501
        return false;
502
    }
503
504
    /**
505
     * {@inheritdoc}

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

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