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

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