Code Duplication    Length = 15-15 lines in 4 locations

lib/Doctrine/DBAL/Platforms/OraclePlatform.php 1 location

@@ 700-714 (lines=15) @@
697
    /**
698
     * {@inheritDoc}
699
     */
700
    public function getDropForeignKeySQL($foreignKey, $table)
701
    {
702
        if (! $foreignKey instanceof ForeignKeyConstraint) {
703
            $foreignKey = new Identifier($foreignKey);
704
        }
705
706
        if (! $table instanceof Table) {
707
            $table = new Identifier($table);
708
        }
709
710
        $foreignKey = $foreignKey->getQuotedName($this);
711
        $table = $table->getQuotedName($this);
712
713
        return 'ALTER TABLE ' . $table . ' DROP CONSTRAINT ' . $foreignKey;
714
    }
715
716
    /**
717
     * {@inheritdoc}

lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php 1 location

@@ 190-204 (lines=15) @@
187
    /**
188
     * {@inheritDoc}
189
     */
190
    public function getDropForeignKeySQL($foreignKey, $table)
191
    {
192
        if (! $foreignKey instanceof ForeignKeyConstraint) {
193
            $foreignKey = new Identifier($foreignKey);
194
        }
195
196
        if (! $table instanceof Table) {
197
            $table = new Identifier($table);
198
        }
199
200
        $foreignKey = $foreignKey->getQuotedName($this);
201
        $table = $table->getQuotedName($this);
202
203
        return 'ALTER TABLE ' . $table . ' DROP CONSTRAINT ' . $foreignKey;
204
    }
205
206
    /**
207
     * {@inheritDoc}

lib/Doctrine/DBAL/Platforms/AbstractPlatform.php 2 locations

@@ 1467-1481 (lines=15) @@
1464
     *
1465
     * @return string
1466
     */
1467
    public function getDropConstraintSQL($constraint, $table)
1468
    {
1469
        if (! $constraint instanceof Constraint) {
1470
            $constraint = new Identifier($constraint);
1471
        }
1472
1473
        if (! $table instanceof Table) {
1474
            $table = new Identifier($table);
1475
        }
1476
1477
        $constraint = $constraint->getQuotedName($this);
1478
        $table = $table->getQuotedName($this);
1479
1480
        return 'ALTER TABLE ' . $table . ' DROP CONSTRAINT ' . $constraint;
1481
    }
1482
1483
    /**
1484
     * Returns the SQL to drop a foreign key.
@@ 1491-1505 (lines=15) @@
1488
     *
1489
     * @return string
1490
     */
1491
    public function getDropForeignKeySQL($foreignKey, $table)
1492
    {
1493
        if (! $foreignKey instanceof ForeignKeyConstraint) {
1494
            $foreignKey = new Identifier($foreignKey);
1495
        }
1496
1497
        if (! $table instanceof Table) {
1498
            $table = new Identifier($table);
1499
        }
1500
1501
        $foreignKey = $foreignKey->getQuotedName($this);
1502
        $table = $table->getQuotedName($this);
1503
1504
        return 'ALTER TABLE ' . $table . ' DROP FOREIGN KEY ' . $foreignKey;
1505
    }
1506
1507
    /**
1508
     * Returns the SQL statement(s) to create a table with the specified name, columns and constraints