Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Add string normalization option(s) to string-based validators #26239

Copy link
Copy link
Closed
@Destroy666x

Description

@Destroy666x
Issue body actions
Q A
Bug report? no
Feature request? yes
BC Break report? no
RFC? no
Symfony version any

As the title says, it would be nice to see trimming and consecutive whitespace merging either as:

  • a single normalize option
  • two trim and mergeConsecutiveWhitespaces options

in LengthValidator at least, maybe also NotBlank if the checked value is a string

Why? Data should be normalized in general, but there are cases where you'd like to store formatted text with enough useful content, for instance forum posts.

I could do a PR, if you like the suggestion let me know which branch would be the most appropriate since it's a small feature, I guess still 4.1.x?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.