Code Duplication    Length = 10-12 lines in 4 locations

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

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

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

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

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

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

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
        return false;
558
    }
559
560
    /**
561
     * {@inheritdoc}