Code Duplication    Length = 6-6 lines in 2 locations

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

@@ 1220-1225 (lines=6) @@
1217
    {
1218
        $parts = $this->getSchemaName($tableName);
1219
1220
        if (is_string($index->getName())) {
1221
            $indexName = $index->getName();
1222
        } else {
1223
            $columnNames = $index->getColumns();
1224
            $indexName = sprintf('%s_%s', $parts['table'], implode('_', $columnNames));
1225
        }
1226
        $def = sprintf(
1227
            "CREATE %s INDEX %s ON %s (%s);",
1228
            ($index->getType() === Index::UNIQUE ? 'UNIQUE' : ''),

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

@@ 1209-1214 (lines=6) @@
1206
     */
1207
    protected function getIndexSqlDefinition(Index $index, $tableName)
1208
    {
1209
        if (is_string($index->getName())) {
1210
            $indexName = $index->getName();
1211
        } else {
1212
            $columnNames = $index->getColumns();
1213
            $indexName = sprintf('%s_%s', $tableName, implode('_', $columnNames));
1214
        }
1215
        $def = sprintf(
1216
            "CREATE %s INDEX %s ON %s (%s);",
1217
            ($index->getType() === Index::UNIQUE ? 'UNIQUE' : ''),