Code Duplication    Length = 16-18 lines in 3 locations

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

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

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

@@ 594-609 (lines=16) @@
591
    /**
592
     * {@inheritdoc}
593
     */
594
    public function dropIndexByName($tableName, $indexName)
595
    {
596
        $indexes = $this->getIndexes($tableName);
597
598
        foreach ($indexes as $index) {
599
            if ($indexName === $index['index']) {
600
                $this->execute(
601
                    sprintf(
602
                        'DROP INDEX %s',
603
                        $this->quoteColumnName($indexName)
604
                    )
605
                );
606
607
                return;
608
            }
609
        }
610
    }
611
612
    /**

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

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