Code Duplication    Length = 10-12 lines in 4 locations

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

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

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

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

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

@@ 667-678 (lines=12) @@
664
    /**
665
     * {@inheritdoc}
666
     */
667
    public function hasIndexByName($tableName, $indexName)
668
    {
669
        $indexes = $this->getIndexes($tableName);
670
671
        foreach ($indexes as $name => $index) {
672
            if ($name === $indexName) {
673
                 return true;
674
            }
675
        }
676
677
        return false;
678
    }
679
680
    /**
681
     * {@inheritdoc}

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

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