Code Duplication    Length = 11-12 lines in 3 locations

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

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

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

@@ 573-584 (lines=12) @@
570
    /**
571
     * @inheritDoc
572
     */
573
    public function hasIndexByName($tableName, $indexName)
574
    {
575
        $indexes = $this->getIndexes($tableName);
576
577
        foreach ($indexes as $name => $index) {
578
            if ($name === $indexName) {
579
                return true;
580
            }
581
        }
582
583
        return false;
584
    }
585
586
    /**
587
     * @inheritDoc

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

@@ 674-684 (lines=11) @@
671
    /**
672
     * @inheritDoc
673
     */
674
    public function hasIndexByName($tableName, $indexName)
675
    {
676
        $indexes = $this->getIndexes($tableName);
677
        foreach ($indexes as $name => $index) {
678
            if ($name === $indexName) {
679
                return true;
680
            }
681
        }
682
683
        return false;
684
    }
685
686
    /**
687
     * @inheritDoc