Code Duplication    Length = 10-12 lines in 4 locations

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

@@ 599-608 (lines=10) @@
596
    /**
597
     * {@inheritdoc}
598
     */
599
    public function hasIndexByName($tableName, $indexName)
600
    {
601
        $indexes = $this->getIndexes($tableName);
602
        foreach ($indexes as $name => $index) {
603
            if ($name === $indexName) {
604
                return true;
605
            }
606
        }
607
608
        return false;
609
    }
610
611
    /**

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

@@ 679-690 (lines=12) @@
676
    /**
677
     * {@inheritdoc}
678
     */
679
    public function hasIndexByName($tableName, $indexName)
680
    {
681
        $indexes = $this->getIndexes($tableName);
682
683
        foreach ($indexes as $name => $index) {
684
            if ($name === $indexName) {
685
                 return true;
686
            }
687
        }
688
689
        return false;
690
    }
691
692
    /**
693
     * {@inheritdoc}

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

@@ 508-519 (lines=12) @@
505
    /**
506
     * {@inheritdoc}
507
     */
508
    public function hasIndexByName($tableName, $indexName)
509
    {
510
        $indexes = $this->getIndexes($tableName);
511
512
        foreach ($indexes as $name => $index) {
513
            if ($name === $indexName) {
514
                return true;
515
            }
516
        }
517
518
        return false;
519
    }
520
521
    /**
522
     * {@inheritdoc}

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

@@ 626-637 (lines=12) @@
623
    /**
624
     * {@inheritdoc}
625
     */
626
    public function hasIndexByName($tableName, $indexName)
627
    {
628
        $indexes = $this->getIndexes($tableName);
629
630
        foreach ($indexes as $index) {
631
            if ($indexName === $index['index']) {
632
                return true;
633
            }
634
        }
635
636
        return false;
637
    }
638
639
    /**
640
     * {@inheritdoc}