Code Duplication    Length = 6-6 lines in 2 locations

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

@@ 1059-1064 (lines=6) @@
1056
    {
1057
        $parts = $this->getSchemaName($tableName);
1058
1059
        if (is_string($index->getName())) {
1060
            $indexName = $index->getName();
1061
        } else {
1062
            $columnNames = $index->getColumns();
1063
            $indexName = sprintf('%s_%s', $parts['table'], implode('_', $columnNames));
1064
        }
1065
        $def = sprintf(
1066
            "CREATE %s INDEX %s ON %s (%s);",
1067
            ($index->getType() === Index::UNIQUE ? 'UNIQUE' : ''),

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

@@ 1045-1050 (lines=6) @@
1042
     */
1043
    protected function getIndexSqlDefinition(Index $index, $tableName)
1044
    {
1045
        if (is_string($index->getName())) {
1046
            $indexName = $index->getName();
1047
        } else {
1048
            $columnNames = $index->getColumns();
1049
            $indexName = sprintf('%s_%s', $tableName, implode('_', $columnNames));
1050
        }
1051
        $def = sprintf(
1052
            "CREATE %s INDEX %s ON %s (%s);",
1053
            ($index->getType() === Index::UNIQUE ? 'UNIQUE' : ''),