Code Duplication    Length = 16-18 lines in 3 locations

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

@@ 581-598 (lines=18) @@
578
    /**
579
     * {@inheritdoc}
580
     */
581
    public function dropIndexByName($tableName, $indexName)
582
    {
583
        $indexes = $this->getIndexes($tableName);
584
585
        foreach ($indexes as $name => $index) {
586
            //$a = array_diff($columns, $index['columns']);
587
            if ($name === $indexName) {
588
                $this->execute(
589
                    sprintf(
590
                        'ALTER TABLE %s DROP INDEX %s',
591
                        $this->quoteTableName($tableName),
592
                        $this->quoteColumnName($indexName)
593
                    )
594
                );
595
596
                return;
597
            }
598
        }
599
    }
600
601
    /**

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

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

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

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