Respect / Validation

The most awesome validation engine ever created for PHP
https://respect-validation.readthedocs.io
MIT License
5.79k stars 776 forks source link

Do not overwrite "IDs" when updating names #1454

Closed henriquemoody closed 6 months ago

henriquemoody commented 6 months ago

When you have a chain of rules in the Validation and overwrite the name with "setName()," it's impossible to get the messages from all rules in the chain as an array because they all have the same name.

These changes will change that behavior by creating a more explicit distinction between "IDs" and "names." The "IDs" will remain unchangeable, while we can always overwrite the names. That means that the array messages will look more similar to the chain, and it will be possible to overwrite the messages from multiple rules in the same chain.

Closes #1333

codecov[bot] commented 6 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 96.29%. Comparing base (9322cd6) to head (d9ef113).

:exclamation: Current head d9ef113 differs from pull request most recent head 8573bc5. Consider uploading reports for the commit 8573bc5 to get more accurate results

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1454 +/- ## ============================================ + Coverage 96.15% 96.29% +0.13% Complexity 912 912 ============================================ Files 198 198 Lines 2082 2103 +21 ============================================ + Hits 2002 2025 +23 + Misses 80 78 -2 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.