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

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