Code Duplication    Length = 9-9 lines in 2 locations

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

@@ 1059-1067 (lines=9) @@
1056
     */
1057
    protected function getIndexSqlDefinition(Index $index, $tableName)
1058
    {
1059
        if (is_string($index->getName())) {
1060
            $indexName = $index->getName();
1061
        } else {
1062
            $columnNames = $index->getColumns();
1063
            if (is_string($columnNames)) {
1064
                $columnNames = [$columnNames];
1065
            }
1066
            $indexName = sprintf('%s_%s', $tableName, implode('_', $columnNames));
1067
        }
1068
        $def = sprintf(
1069
            "CREATE %s INDEX %s ON %s (%s);",
1070
            ($index->getType() === Index::UNIQUE ? 'UNIQUE' : ''),

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

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