Code Duplication    Length = 15-15 lines in 2 locations

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

@@ 1071-1085 (lines=15) @@
1068
     * @param \Phinx\Db\Table\ForeignKey $foreignKey
1069
     * @return string
1070
     */
1071
    protected function getForeignKeySqlDefinition(ForeignKey $foreignKey, $tableName)
1072
    {
1073
        $constraintName = $foreignKey->getConstraint() ?: $tableName . '_' . implode('_', $foreignKey->getColumns());
1074
        $def = ' CONSTRAINT ' . $this->quoteColumnName($constraintName);
1075
        $def .= ' FOREIGN KEY ("' . implode('", "', $foreignKey->getColumns()) . '")';
1076
        $def .= " REFERENCES {$this->quoteTableName($foreignKey->getReferencedTable()->getName())} (\"" . implode('", "', $foreignKey->getReferencedColumns()) . '")';
1077
        if ($foreignKey->getOnDelete()) {
1078
            $def .= " ON DELETE {$foreignKey->getOnDelete()}";
1079
        }
1080
        if ($foreignKey->getOnUpdate()) {
1081
            $def .= " ON UPDATE {$foreignKey->getOnUpdate()}";
1082
        }
1083
1084
        return $def;
1085
    }
1086
1087
    /**
1088
     * {@inheritdoc}

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

@@ 1046-1060 (lines=15) @@
1043
     * @param string     $tableName  Table name
1044
     * @return string
1045
     */
1046
    protected function getForeignKeySqlDefinition(ForeignKey $foreignKey, $tableName)
1047
    {
1048
        $constraintName = $foreignKey->getConstraint() ?: $tableName . '_' . implode('_', $foreignKey->getColumns());
1049
1050
        $def = ' CONSTRAINT "' . $constraintName . '" FOREIGN KEY ("' . implode('", "', $foreignKey->getColumns()) . '")';
1051
        $def .= " REFERENCES {$this->quoteTableName($foreignKey->getReferencedTable()->getName())} (\"" . implode('", "', $foreignKey->getReferencedColumns()) . '")';
1052
        if ($foreignKey->getOnDelete()) {
1053
            $def .= " ON DELETE {$foreignKey->getOnDelete()}";
1054
        }
1055
        if ($foreignKey->getOnUpdate()) {
1056
            $def .= " ON UPDATE {$foreignKey->getOnUpdate()}";
1057
        }
1058
1059
        return $def;
1060
    }
1061
1062
    /**
1063
     * {@inheritdoc}