Code Duplication    Length = 6-6 lines in 2 locations

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

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

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

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