Code Duplication    Length = 16-18 lines in 3 locations

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

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

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
                return;
618
            }
619
        }
620
    }
621
622
    /**
623
     * {@inheritdoc}

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

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