Code Duplication    Length = 10-12 lines in 4 locations

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

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

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

@@ 519-530 (lines=12) @@
516
    /**
517
     * {@inheritdoc}
518
     */
519
    public function hasIndexByName($tableName, $indexName)
520
    {
521
        $indexes = $this->getIndexes($tableName);
522
523
        foreach ($indexes as $name => $index) {
524
            if ($name === $indexName) {
525
                 return true;
526
            }
527
        }
528
529
        return false;
530
    }
531
532
    /**
533
     * {@inheritdoc}

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

@@ 543-552 (lines=10) @@
540
    /**
541
     * {@inheritdoc}
542
     */
543
    public function hasIndexByName($tableName, $indexName)
544
    {
545
        $indexes = $this->getIndexes($tableName);
546
        foreach ($indexes as $name => $index) {
547
            if ($name === $indexName) {
548
                return true;
549
            }
550
        }
551
552
        return false;
553
    }
554
555
    /**

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

@@ 553-564 (lines=12) @@
550
    /**
551
     * {@inheritdoc}
552
     */
553
    public function hasIndexByName($tableName, $indexName)
554
    {
555
        $indexes = $this->getIndexes($tableName);
556
557
        foreach ($indexes as $index) {
558
            if ($indexName === $index['index']) {
559
                return true;
560
            }
561
        }
562
563
        return false;
564
    }
565
566
    /**
567
     * {@inheritdoc}