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

@@ 1032-1040 (lines=9) @@
1029
     */
1030
    protected function getIndexSqlDefinition(Index $index, $tableName)
1031
    {
1032
        if (is_string($index->getName())) {
1033
            $indexName = $index->getName();
1034
        } else {
1035
            $columnNames = $index->getColumns();
1036
            if (is_string($columnNames)) {
1037
                $columnNames = [$columnNames];
1038
            }
1039
            $indexName = sprintf('%s_%s', $tableName, implode('_', $columnNames));
1040
        }
1041
        $def = sprintf(
1042
            "CREATE %s INDEX %s ON %s (%s);",
1043
            ($index->getType() === Index::UNIQUE ? 'UNIQUE' : ''),