Code Duplication    Length = 15-15 lines in 2 locations

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

@@ 999-1013 (lines=15) @@
996
     * @param string     $tableName  Table name
997
     * @return string
998
     */
999
    protected function getForeignKeySqlDefinition(ForeignKey $foreignKey, $tableName)
1000
    {
1001
        $constraintName = $foreignKey->getConstraint() ?: $tableName . '_' . implode('_', $foreignKey->getColumns());
1002
1003
        $def = ' CONSTRAINT "' . $constraintName . '" FOREIGN KEY ("' . implode('", "', $foreignKey->getColumns()) . '")';
1004
        $def .= " REFERENCES {$this->quoteTableName($foreignKey->getReferencedTable()->getName())} (\"" . implode('", "', $foreignKey->getReferencedColumns()) . '")';
1005
        if ($foreignKey->getOnDelete()) {
1006
            $def .= " ON DELETE {$foreignKey->getOnDelete()}";
1007
        }
1008
        if ($foreignKey->getOnUpdate()) {
1009
            $def .= " ON UPDATE {$foreignKey->getOnUpdate()}";
1010
        }
1011
1012
        return $def;
1013
    }
1014
1015
    /**
1016
     * {@inheritdoc}

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

@@ 1111-1125 (lines=15) @@
1108
     * @param \Phinx\Db\Table\ForeignKey $foreignKey
1109
     * @return string
1110
     */
1111
    protected function getForeignKeySqlDefinition(ForeignKey $foreignKey, $tableName)
1112
    {
1113
        $constraintName = $foreignKey->getConstraint() ?: $tableName . '_' . implode('_', $foreignKey->getColumns());
1114
        $def = ' CONSTRAINT ' . $this->quoteColumnName($constraintName);
1115
        $def .= ' FOREIGN KEY ("' . implode('", "', $foreignKey->getColumns()) . '")';
1116
        $def .= " REFERENCES {$this->quoteTableName($foreignKey->getReferencedTable()->getName())} (\"" . implode('", "', $foreignKey->getReferencedColumns()) . '")';
1117
        if ($foreignKey->getOnDelete()) {
1118
            $def .= " ON DELETE {$foreignKey->getOnDelete()}";
1119
        }
1120
        if ($foreignKey->getOnUpdate()) {
1121
            $def .= " ON UPDATE {$foreignKey->getOnUpdate()}";
1122
        }
1123
1124
        return $def;
1125
    }
1126
1127
    /**
1128
     * {@inheritdoc}