Code Duplication    Length = 10-12 lines in 4 locations

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

@@ 531-542 (lines=12) @@
528
    /**
529
     * {@inheritdoc}
530
     */
531
    public function hasIndexByName($tableName, $indexName)
532
    {
533
        $indexes = $this->getIndexes($tableName);
534
535
        foreach ($indexes as $index) {
536
            if ($indexName === $index['index']) {
537
                return true;
538
            }
539
        }
540
541
        return false;
542
    }
543
544
    /**
545
     * {@inheritdoc}

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

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

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

@@ 563-572 (lines=10) @@
560
    /**
561
     * {@inheritdoc}
562
     */
563
    public function hasIndexByName($tableName, $indexName)
564
    {
565
        $indexes = $this->getIndexes($tableName);
566
        foreach ($indexes as $name => $index) {
567
            if ($name === $indexName) {
568
                return true;
569
            }
570
        }
571
572
        return false;
573
    }
574
575
    /**