Code Duplication    Length = 6-6 lines in 2 locations

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

@@ 1181-1186 (lines=6) @@
1178
    {
1179
        $parts = $this->getSchemaName($tableName);
1180
1181
        if (is_string($index->getName())) {
1182
            $indexName = $index->getName();
1183
        } else {
1184
            $columnNames = $index->getColumns();
1185
            $indexName = sprintf('%s_%s', $parts['table'], implode('_', $columnNames));
1186
        }
1187
        $def = sprintf(
1188
            "CREATE %s INDEX %s ON %s (%s);",
1189
            ($index->getType() === Index::UNIQUE ? 'UNIQUE' : ''),

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

@@ 1195-1200 (lines=6) @@
1192
     */
1193
    protected function getIndexSqlDefinition(Index $index, $tableName)
1194
    {
1195
        if (is_string($index->getName())) {
1196
            $indexName = $index->getName();
1197
        } else {
1198
            $columnNames = $index->getColumns();
1199
            $indexName = sprintf('%s_%s', $tableName, implode('_', $columnNames));
1200
        }
1201
        $def = sprintf(
1202
            "CREATE %s INDEX %s ON %s (%s);",
1203
            ($index->getType() === Index::UNIQUE ? 'UNIQUE' : ''),