Code Duplication    Length = 9-9 lines in 2 locations

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

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

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

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