Code Duplication    Length = 9-9 lines in 2 locations

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

@@ 977-985 (lines=9) @@
974
     */
975
    protected function getIndexSqlDefinition(Index $index, $tableName)
976
    {
977
        if (is_string($index->getName())) {
978
            $indexName = $index->getName();
979
        } else {
980
            $columnNames = $index->getColumns();
981
            if (is_string($columnNames)) {
982
                $columnNames = [$columnNames];
983
            }
984
            $indexName = sprintf('%s_%s', $tableName, implode('_', $columnNames));
985
        }
986
        $def = sprintf(
987
            "CREATE %s INDEX %s ON %s (%s);",
988
            ($index->getType() === Index::UNIQUE ? 'UNIQUE' : ''),

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

@@ 1076-1084 (lines=9) @@
1073
     */
1074
    protected function getIndexSqlDefinition(Index $index, $tableName)
1075
    {
1076
        if (is_string($index->getName())) {
1077
            $indexName = $index->getName();
1078
        } else {
1079
            $columnNames = $index->getColumns();
1080
            if (is_string($columnNames)) {
1081
                $columnNames = [$columnNames];
1082
            }
1083
            $indexName = sprintf('%s_%s', $tableName, implode('_', $columnNames));
1084
        }
1085
        $def = sprintf(
1086
            "CREATE %s INDEX %s ON %s (%s);",
1087
            ($index->getType() === Index::UNIQUE ? 'UNIQUE' : ''),