Code Duplication    Length = 10-12 lines in 4 locations

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

@@ 605-616 (lines=12) @@
602
    /**
603
     * {@inheritdoc}
604
     */
605
    public function hasIndexByName($tableName, $indexName)
606
    {
607
        $indexes = $this->getIndexes($tableName);
608
609
        foreach ($indexes as $name => $index) {
610
            if ($name === $indexName) {
611
                return true;
612
            }
613
        }
614
615
        return false;
616
    }
617
618
    /**
619
     * {@inheritdoc}

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

@@ 686-695 (lines=10) @@
683
    /**
684
     * {@inheritdoc}
685
     */
686
    public function hasIndexByName($tableName, $indexName)
687
    {
688
        $indexes = $this->getIndexes($tableName);
689
        foreach ($indexes as $name => $index) {
690
            if ($name === $indexName) {
691
                return true;
692
            }
693
        }
694
695
        return false;
696
    }
697
698
    /**

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

@@ 683-694 (lines=12) @@
680
    /**
681
     * {@inheritdoc}
682
     */
683
    public function hasIndexByName($tableName, $indexName)
684
    {
685
        $indexes = $this->getIndexes($tableName);
686
687
        foreach ($indexes as $index) {
688
            if ($indexName === $index['index']) {
689
                return true;
690
            }
691
        }
692
693
        return false;
694
    }
695
696
    /**
697
     * {@inheritdoc}

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

@@ 751-762 (lines=12) @@
748
    /**
749
     * {@inheritdoc}
750
     */
751
    public function hasIndexByName($tableName, $indexName)
752
    {
753
        $indexes = $this->getIndexes($tableName);
754
755
        foreach ($indexes as $name => $index) {
756
            if ($name === $indexName) {
757
                 return true;
758
            }
759
        }
760
761
        return false;
762
    }
763
764
    /**
765
     * {@inheritdoc}