Code Duplication    Length = 13-17 lines in 2 locations

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

@@ 498-514 (lines=17) @@
495
    /**
496
     * {@inheritdoc}
497
     */
498
    public function hasIndex($tableName, $columns)
499
    {
500
        if (is_string($columns)) {
501
            $columns = [$columns]; // str to array
502
        }
503
504
        $columns = array_map('strtolower', $columns);
505
        $indexes = $this->getIndexes($tableName);
506
507
        foreach ($indexes as $index) {
508
            if ($columns == $index['columns']) {
509
                return true;
510
            }
511
        }
512
513
        return false;
514
    }
515
516
    /**
517
     * {@inheritdoc}

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

@@ 542-554 (lines=13) @@
539
    /**
540
     * {@inheritdoc}
541
     */
542
    public function hasIndex($tableName, $columns)
543
    {
544
        if (is_string($columns)) {
545
            $columns = [$columns];
546
        }
547
        $indexes = $this->getIndexes($tableName);
548
        foreach ($indexes as $index) {
549
            if (array_diff($index['columns'], $columns) === array_diff($columns, $index['columns'])) {
550
                return true;
551
            }
552
        }
553
554
        return false;
555
    }
556
557
    /**