Code Duplication    Length = 10-12 lines in 4 locations

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

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

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

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

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

@@ 546-557 (lines=12) @@
543
    /**
544
     * {@inheritdoc}
545
     */
546
    public function hasIndexByName($tableName, $indexName)
547
    {
548
        $indexes = $this->getIndexes($tableName);
549
550
        foreach ($indexes as $index) {
551
            if ($indexName === $index['index']) {
552
                return true;
553
            }
554
        }
555
556
        return false;
557
    }
558
559
    /**
560
     * {@inheritdoc}

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

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