Code Duplication    Length = 9-9 lines in 2 locations

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

@@ 982-990 (lines=9) @@
979
     */
980
    protected function getIndexSqlDefinition(Index $index, $tableName)
981
    {
982
        if (is_string($index->getName())) {
983
            $indexName = $index->getName();
984
        } else {
985
            $columnNames = $index->getColumns();
986
            if (is_string($columnNames)) {
987
                $columnNames = [$columnNames];
988
            }
989
            $indexName = sprintf('%s_%s', $tableName, implode('_', $columnNames));
990
        }
991
        $def = sprintf(
992
            "CREATE %s INDEX %s ON %s (%s);",
993
            ($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' : ''),