Code Duplication    Length = 6-6 lines in 2 locations

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

@@ 1192-1197 (lines=6) @@
1189
    {
1190
        $parts = $this->getSchemaName($tableName);
1191
1192
        if (is_string($index->getName())) {
1193
            $indexName = $index->getName();
1194
        } else {
1195
            $columnNames = $index->getColumns();
1196
            $indexName = sprintf('%s_%s', $parts['table'], implode('_', $columnNames));
1197
        }
1198
        $def = sprintf(
1199
            "CREATE %s INDEX %s ON %s (%s);",
1200
            ($index->getType() === Index::UNIQUE ? 'UNIQUE' : ''),

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

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