Code Duplication    Length = 9-9 lines in 2 locations

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

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

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

@@ 1084-1092 (lines=9) @@
1081
     */
1082
    protected function getIndexSqlDefinition(Index $index, $tableName)
1083
    {
1084
        if (is_string($index->getName())) {
1085
            $indexName = $index->getName();
1086
        } else {
1087
            $columnNames = $index->getColumns();
1088
            if (is_string($columnNames)) {
1089
                $columnNames = [$columnNames];
1090
            }
1091
            $indexName = sprintf('%s_%s', $tableName, implode('_', $columnNames));
1092
        }
1093
        $def = sprintf(
1094
            "CREATE %s INDEX %s ON %s (%s);",
1095
            ($index->getType() === Index::UNIQUE ? 'UNIQUE' : ''),