Skip to content
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

Fix OneOf and AtLeast messages #625

Merged
merged 10 commits into from
Aug 26, 2023
Merged

Fix OneOf and AtLeast messages #625

merged 10 commits into from
Aug 26, 2023

Conversation

arogachev
Copy link
Contributor

@arogachev arogachev commented Aug 21, 2023

Q A
Is bugfix?
New feature?
Breaks BC? ✔️

@what-the-diff
Copy link

what-the-diff bot commented Aug 21, 2023

PR Summary

  • Enhanced Validation Error Messages
    The feedback messages for validation rules "AtLeast" and "OneOf" have been made more meaningful. They now inform users specifically about the number of data fields that should be filled.

  • Addition of TranslatedAttributesHandlerTrait
    To improve language flexibility, a trait named 'TranslatedAttributesHandlerTrait' has been introduced. This aids in formatting and translating attribute names.

  • Improvements in Adding Errors
    The 'addError' method in the validate functions has been updated. Now, it considers an entire set of attributes rather than a single one. This gives a more accurate picture of the failed validation.

  • Introduction of a More Robust Error Generation Method
    The 'getGenericErrorResult' method has been revamped in 'OneOfHandler'. Instead of simply accepting a string message, it now accepts an instance of the 'OneOf' class. This enables more detailed error results.

  • Updates in Test Cases
    Textual descriptions in test cases for 'AtLeastTest' and 'OneOfTest' were updated to match the improved validation error messages.

@codecov
Copy link

codecov bot commented Aug 21, 2023

Codecov Report

Patch coverage: 97.53% and project coverage change: +0.10% 🎉

Comparison is base (def3a69) 94.30% compared to head (6dca8ba) 94.40%.
Report is 3 commits behind head on master.

❗ Current head 6dca8ba differs from pull request most recent head 3f6345f. Consider uploading reports for the commit 3f6345f to get more accurate results

Additional details and impacted files
@@             Coverage Diff              @@
##             master     #625      +/-   ##
============================================
+ Coverage     94.30%   94.40%   +0.10%     
- Complexity      749      775      +26     
============================================
  Files            88       91       +3     
  Lines          2281     2358      +77     
============================================
+ Hits           2151     2226      +75     
- Misses          130      132       +2     
Files Changed Coverage Δ
src/Rule/AtLeast.php 93.54% <0.00%> (-6.46%) ⬇️
src/Rule/IpHandler.php 100.00% <ø> (ø)
src/Rule/AbstractNumber.php 100.00% <100.00%> (ø)
src/Rule/AtLeastHandler.php 100.00% <100.00%> (ø)
src/Rule/Email.php 100.00% <100.00%> (ø)
src/Rule/OneOf.php 100.00% <100.00%> (ø)
src/Rule/OneOfHandler.php 100.00% <100.00%> (ø)
src/Rule/Regex.php 100.00% <100.00%> (ø)
...rc/Rule/Trait/TranslatedAttributesHandlerTrait.php 100.00% <100.00%> (ø)
src/Rule/Url.php 100.00% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@arogachev arogachev marked this pull request as ready for review August 21, 2023 12:15
@arogachev arogachev requested a review from a team August 21, 2023 12:16
@arogachev arogachev added status:code review The pull request needs review. type:task Task labels Aug 21, 2023
@samdark samdark merged commit 4e79a26 into master Aug 26, 2023
@samdark samdark deleted the fix-at-least-and-one-of branch August 26, 2023 01:45
@samdark
Copy link
Member

samdark commented Aug 26, 2023

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:code review The pull request needs review. type:task Task
Projects
None yet
3 participants