Code Duplication    Length = 9-9 lines in 2 locations

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

@@ 1045-1053 (lines=9) @@
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
            if (is_string($columnNames)) {
1050
                $columnNames = [$columnNames];
1051
            }
1052
            $indexName = sprintf('%s_%s', $tableName, implode('_', $columnNames));
1053
        }
1054
        $def = sprintf(
1055
            "CREATE %s INDEX %s ON %s (%s);",
1056
            ($index->getType() === Index::UNIQUE ? 'UNIQUE' : ''),

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

@@ 1000-1008 (lines=9) @@
997
     */
998
    protected function getIndexSqlDefinition(Index $index, $tableName)
999
    {
1000
        if (is_string($index->getName())) {
1001
            $indexName = $index->getName();
1002
        } else {
1003
            $columnNames = $index->getColumns();
1004
            if (is_string($columnNames)) {
1005
                $columnNames = [$columnNames];
1006
            }
1007
            $indexName = sprintf('%s_%s', $tableName, implode('_', $columnNames));
1008
        }
1009
        $def = sprintf(
1010
            "CREATE %s INDEX %s ON %s (%s);",
1011
            ($index->getType() === Index::UNIQUE ? 'UNIQUE' : ''),