Code Duplication    Length = 9-9 lines in 2 locations

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

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

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

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