Code Duplication    Length = 16-18 lines in 3 locations

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

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

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
    /**