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

@@ 1458-1472 (lines=15) @@
1455
     *
1456
     * @return string
1457
     */
1458
    public function getDropConstraintSQL($constraint, $table)
1459
    {
1460
        if (! $constraint instanceof Constraint) {
1461
            $constraint = new Identifier($constraint);
1462
        }
1463
1464
        if (! $table instanceof Table) {
1465
            $table = new Identifier($table);
1466
        }
1467
1468
        $constraint = $constraint->getQuotedName($this);
1469
        $table = $table->getQuotedName($this);
1470
1471
        return 'ALTER TABLE ' . $table . ' DROP CONSTRAINT ' . $constraint;
1472
    }
1473
1474
    /**
1475
     * Returns the SQL to drop a foreign key.
@@ 1482-1496 (lines=15) @@
1479
     *
1480
     * @return string
1481
     */
1482
    public function getDropForeignKeySQL($foreignKey, $table)
1483
    {
1484
        if (! $foreignKey instanceof ForeignKeyConstraint) {
1485
            $foreignKey = new Identifier($foreignKey);
1486
        }
1487
1488
        if (! $table instanceof Table) {
1489
            $table = new Identifier($table);
1490
        }
1491
1492
        $foreignKey = $foreignKey->getQuotedName($this);
1493
        $table = $table->getQuotedName($this);
1494
1495
        return 'ALTER TABLE ' . $table . ' DROP FOREIGN KEY ' . $foreignKey;
1496
    }
1497
1498
    /**
1499
     * Returns the SQL statement(s) to create a table with the specified name, columns and constraints