Code Duplication    Length = 8-8 lines in 2 locations

src/Phinx/Db/Adapter/MysqlAdapter.php 2 locations

@@ 641-648 (lines=8) @@
638
        $indexes = $this->getIndexes($tableName);
639
        $columns = array_map('strtolower', $columns);
640
641
        foreach ($indexes as $indexName => $index) {
642
            if ($columns == $index['columns']) {
643
                return new AlterInstructions([sprintf(
644
                    'DROP INDEX %s',
645
                    $this->quoteColumnName($indexName)
646
                )]);
647
            }
648
        }
649
650
        throw new \InvalidArgumentException(sprintf(
651
            "The specified index on columns '%s' does not exist",
@@ 664-671 (lines=8) @@
661
662
        $indexes = $this->getIndexes($tableName);
663
664
        foreach ($indexes as $name => $index) {
665
            if ($name === $indexName) {
666
                return new AlterInstructions([sprintf(
667
                    'DROP INDEX %s',
668
                    $this->quoteColumnName($indexName)
669
                )]);
670
            }
671
        }
672
673
        throw new \InvalidArgumentException(sprintf(
674
            "The specified index name '%s' does not exist",