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

Move out getName() from RuleInterface #640

Merged
merged 9 commits into from
Nov 30, 2023
Merged

Move out getName() from RuleInterface #640

merged 9 commits into from
Nov 30, 2023

Conversation

arogachev
Copy link
Contributor

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

@arogachev arogachev requested a review from a team November 28, 2023 13:26
@arogachev arogachev self-assigned this Nov 28, 2023
@arogachev arogachev added the status:code review The pull request needs review. label Nov 28, 2023
Copy link

codecov bot commented Nov 28, 2023

Codecov Report

Attention: 30 lines in your changes are missing coverage. Please review.

Comparison is base (493a2d1) 94.45% compared to head (76fb3ff) 12.30%.
Report is 1 commits behind head on master.

Files Patch % Lines
src/Rule/JsonHandler.php 0.00% 4 Missing ⚠️
src/Helper/RulesDumper.php 0.00% 2 Missing ⚠️
src/Rule/AbstractCompare.php 0.00% 2 Missing ⚠️
src/Rule/AbstractNumber.php 0.00% 2 Missing ⚠️
src/Rule/AtLeast.php 0.00% 1 Missing ⚠️
src/Rule/BooleanValue.php 0.00% 1 Missing ⚠️
src/Rule/Callback.php 0.00% 1 Missing ⚠️
src/Rule/Composite.php 0.00% 1 Missing ⚠️
src/Rule/Count.php 0.00% 1 Missing ⚠️
src/Rule/Each.php 0.00% 1 Missing ⚠️
... and 14 more
Additional details and impacted files
@@              Coverage Diff              @@
##             master     #640       +/-   ##
=============================================
- Coverage     94.45%   12.30%   -82.15%     
+ Complexity      776      770        -6     
=============================================
  Files            91       90        -1     
  Lines          2361     2348       -13     
=============================================
- Hits           2230      289     -1941     
- Misses          131     2059     +1928     

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

Copy link

what-the-diff bot commented Nov 28, 2023

PR Summary

This pull request includes a series of updates and enhancements which primarily involve changes related to the renaming of the RuleWithOptionsInterface interface to DumpedRuleInterface. These changes have been rolled out across many files and code segments.

  • Adjustment to validation rules
    The validation rule name length has been updated to Yiisoft\Validator\Rule\Length for higher accuracy.

  • Change in rule interfaces
    The RuleWithOptionsInterface interface has been renamed as DumpedRuleInterface. This is reflected in multiple files where the old interface was imported. The files ranging from rule definitions (e.g., at-least.php, boolean-value.php, etc.) to tests (e.g., compare.php, email.php, etc.) all now use the new DumpedRuleInterface.

  • Update in processing method
    In rules-dumper.php, the method for fetching options has been updated, now it handles instances of DumpedRuleInterface instead of the previous RuleWithOptionsInterface.

  • Removal of getName() method
    The method getName() was removed from Yaml and RgbColor classes, and consequently from RuleInterface. This has also led to the removal or alteration of this method in several test cases and classes.

  • Test classes now use class names instead of string names
    Some test cases in RulesDumperTest now use explicit class reference (like Integer, BooleanValue, and Required) instead of string names.

  • Addition of getName() method to multiple test classes
    Numerous test classes (like BooleanValueTest, CallbackTest, CompareTest, etc.) now contain the getName() method that returns the class name for better identification.

  • Replacement of string rule names with class constants
    In various test files, string rule names have been substituted by class constants for more robust referencing.

These changes aim to improve the readability and stability of the codebase.

@arogachev arogachev linked an issue Nov 28, 2023 that may be closed by this pull request
src/DumpedRuleInterface.php Show resolved Hide resolved
src/Rule/GreaterThanOrEqual.php Outdated Show resolved Hide resolved
@arogachev arogachev merged commit e052235 into master Nov 30, 2023
19 of 31 checks passed
@arogachev arogachev deleted the 634-move-rule-name branch November 30, 2023 12:42
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Move out getName() from RuleInterface
3 participants