Code Duplication    Length = 10-12 lines in 4 locations

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

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

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

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

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

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

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

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