Code Duplication    Length = 15-15 lines in 4 locations

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

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

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}