Code Duplication    Length = 6-6 lines in 2 locations

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

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

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

@@ 1186-1191 (lines=6) @@
1183
     */
1184
    protected function getIndexSqlDefinition(Index $index, $tableName)
1185
    {
1186
        if (is_string($index->getName())) {
1187
            $indexName = $index->getName();
1188
        } else {
1189
            $columnNames = $index->getColumns();
1190
            $indexName = sprintf('%s_%s', $tableName, implode('_', $columnNames));
1191
        }
1192
        $def = sprintf(
1193
            "CREATE %s INDEX %s ON %s (%s);",
1194
            ($index->getType() === Index::UNIQUE ? 'UNIQUE' : ''),