Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Validator] Add normalizer option to Unique constraint #15124

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

henry2778
Copy link
Contributor

@henry2778 henry2778 commented Mar 19, 2021

Hello. Documenting the feature symfony/symfony#38488 about normalizer option for Unique constraint.

  1. Updated the intro paragraph mentioning the strict comparison
  2. Added normalizer to the option list
  3. Added normalizer option description. There is a include file for that, but since the description is slightly different, I decided not use it.

Thanks!

:phpfunction:`trim` PHP function to each element of the collection in order to ignore leading and trailing
whitespace during validation.

.. _`PHP callable`: https://www.php.net/callable
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please move this to the bottom of the file

For example, you may want to pass the ``'trim'`` string to apply the
:phpfunction:`trim` PHP function to each element of the collection in order to ignore leading and trailing
whitespace during validation.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a versionadded directive

The ''normalizer'' option was introduced in Symfony 5.3.

' is a backtick, I am currently on a phone 📱😄

@@ -107,8 +109,8 @@ Options

.. include:: /reference/constraints/_groups-option.rst.inc

message
~~~~~~~
``message``
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this the case for all constraints? If yes this should be fixed in the lowest maintained branch (4.4) for the constraints.

We would be glad to receive such a PR from your side, but if you don't have time, no worries.

This should not be fixed in this PR, so please revert this line, thanks

@OskarStark OskarStark added this to the 5.3 milestone Mar 21, 2021
@henry2778
Copy link
Contributor Author

@OskarStark thanks. fixed

@javiereguiluz javiereguiluz force-pushed the feature/unique-normalizer-option branch from 227c9a1 to 92072d9 Compare March 27, 2021 19:00
@javiereguiluz javiereguiluz merged commit b4d93f3 into symfony:5.x Mar 27, 2021
@javiereguiluz
Copy link
Member

Andrii, thanks for this nice contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants