Code Duplication    Length = 8-12 lines in 3 locations

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

@@ 539-546 (lines=8) @@
536
        $indexes = $this->getIndexes($tableName);
537
        $columns = array_map('strtolower', $columns);
538
539
        foreach ($indexes as $indexName => $index) {
540
            if ($columns == $index['columns']) {
541
                return new AlterInstructions([sprintf(
542
                    'DROP INDEX %s',
543
                    $this->quoteColumnName($indexName)
544
                )]);
545
            }
546
        }
547
548
        throw new \InvalidArgumentException(sprintf(
549
            "The specified index on columns '%s' does not exist",
@@ 562-569 (lines=8) @@
559
560
        $indexes = $this->getIndexes($tableName);
561
562
        foreach ($indexes as $name => $index) {
563
            if ($name === $indexName) {
564
                return new AlterInstructions([sprintf(
565
                    'DROP INDEX %s',
566
                    $this->quoteColumnName($indexName)
567
                )]);
568
            }
569
        }
570
571
        throw new \InvalidArgumentException(sprintf(
572
            "The specified index name '%s' does not exist",

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

@@ 584-595 (lines=12) @@
581
    {
582
        $indexes = $this->getIndexes($tableName);
583
584
        foreach ($indexes as $name => $index) {
585
            if ($name === $indexName) {
586
                $this->execute(
587
                    sprintf(
588
                        'DROP INDEX %s',
589
                        $this->quoteColumnName($indexName)
590
                    )
591
                );
592
593
                break;
594
            }
595
        }
596
    }
597
598
    /**