Code Duplication    Length = 16-18 lines in 3 locations

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

@@ 564-581 (lines=18) @@
561
    /**
562
     * {@inheritdoc}
563
     */
564
    public function dropIndexByName($tableName, $indexName)
565
    {
566
        $indexes = $this->getIndexes($tableName);
567
568
        foreach ($indexes as $name => $index) {
569
            //$a = array_diff($columns, $index['columns']);
570
            if ($name === $indexName) {
571
                $this->execute(
572
                    sprintf(
573
                        'ALTER TABLE %s DROP INDEX %s',
574
                        $this->quoteTableName($tableName),
575
                        $this->quoteColumnName($indexName)
576
                    )
577
                );
578
579
                return;
580
            }
581
        }
582
    }
583
584
    /**

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

@@ 711-727 (lines=17) @@
708
    /**
709
     * {@inheritdoc}
710
     */
711
    public function dropIndexByName($tableName, $indexName)
712
    {
713
        $indexes = $this->getIndexes($tableName);
714
715
        foreach ($indexes as $name => $index) {
716
            if ($name === $indexName) {
717
                $this->execute(
718
                    sprintf(
719
                        'DROP INDEX %s ON %s',
720
                        $this->quoteColumnName($indexName),
721
                        $this->quoteTableName($tableName)
722
                    )
723
                );
724
725
                return;
726
            }
727
        }
728
    }
729
730
    /**

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

@@ 609-624 (lines=16) @@
606
    /**
607
     * {@inheritdoc}
608
     */
609
    public function dropIndexByName($tableName, $indexName)
610
    {
611
        $indexes = $this->getIndexes($tableName);
612
613
        foreach ($indexes as $index) {
614
            if ($indexName === $index['index']) {
615
                $this->execute(
616
                    sprintf(
617
                        'DROP INDEX %s',
618
                        $this->quoteColumnName($indexName)
619
                    )
620
                );
621
622
                return;
623
            }
624
        }
625
    }
626
627
    /**