Code Duplication    Length = 10-12 lines in 4 locations

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

@@ 730-741 (lines=12) @@
727
    /**
728
     * {@inheritdoc}
729
     */
730
    public function hasIndexByName($tableName, $indexName)
731
    {
732
        $indexes = $this->getIndexes($tableName);
733
734
        foreach ($indexes as $name => $index) {
735
            if ($name === $indexName) {
736
                 return true;
737
            }
738
        }
739
740
        return false;
741
    }
742
743
    /**
744
     * {@inheritdoc}

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

@@ 656-665 (lines=10) @@
653
    /**
654
     * {@inheritdoc}
655
     */
656
    public function hasIndexByName($tableName, $indexName)
657
    {
658
        $indexes = $this->getIndexes($tableName);
659
        foreach ($indexes as $name => $index) {
660
            if ($name === $indexName) {
661
                return true;
662
            }
663
        }
664
665
        return false;
666
    }
667
668
    /**

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

@@ 560-571 (lines=12) @@
557
    /**
558
     * {@inheritdoc}
559
     */
560
    public function hasIndexByName($tableName, $indexName)
561
    {
562
        $indexes = $this->getIndexes($tableName);
563
564
        foreach ($indexes as $name => $index) {
565
            if ($name === $indexName) {
566
                return true;
567
            }
568
        }
569
570
        return false;
571
    }
572
573
    /**
574
     * {@inheritdoc}

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

@@ 727-738 (lines=12) @@
724
    /**
725
     * {@inheritdoc}
726
     */
727
    public function hasIndexByName($tableName, $indexName)
728
    {
729
        $indexes = $this->getIndexes($tableName);
730
731
        foreach ($indexes as $index) {
732
            if ($indexName === $index['index']) {
733
                return true;
734
            }
735
        }
736
737
        return false;
738
    }
739
740
    /**
741
     * {@inheritdoc}