Closed vjik closed 7 months ago
Q | A |
---|---|
Is bugfix? | ❌ |
New feature? | ❌ |
Breaks BC? | ❌ |
Fixed issues |
PHP versions extended To ensure the project runs smoothly on the latest PHP versions, it has been made compatible with PHP versions up to 8.3.
Code cleaning
The unrequired psalm80.xml
file was deleted, optimizing the codebase.
Package.json Updated
Updated composer.json
to increase compatibility by accepting pHp 8.1 and beyond.
Detailed Change Documentation
Information about new rules and changes has been added to the CHANGELOG.md
file.
Multiple Language Support for Validation
New translations have been provided for validator in the yii-validator.php
.
Rule Interface Restructured
The RuleWithOptionsInterface.php
has been renamed to DumpedRuleInterface.php
. Extra functionalities have been added with two new methods- getName()
and getLabels()
.
Improved Code Efficiency with Caching
The method getReflectionProperties()
and setCacheItem()
have been updated initiative caching, that will improve code performance.
Implementation of LabelProviderInterface
This interface has been implemented in the ObjectDataSet
class for better organization and coherence.
Added and Updated Handlers and Labels Several handlers and labels have been added or updated accordingly across multiple classes.
Enhanced Error Message Handling Error messages across several methods have been modified to return more explicit and type-specific errors improving the debugging process.
Traits Enhanced
The TranslatedAttributesHandlerTrait
method was added in the OneOfHandler
class for better handling of attributes.
New DateTime related Classes
A new rule for validating date values has been added with the creation of DateTime
and DateTimeHandler
classes.
Enhancement of Testing Files
Multiple testing files were updated and enhanced to include newer pre-set assertions and the AtLeast
class was set to check if its min
is greater than the number of attributes, providing a more robust testing suite.
Deletion of Redundant getName Method
The getName
method was removed from multipl classes - Equal
, GreaterThan
, GreaterThanOrEqual
, Integer
, LessThan
, LessThanOrEqual
, NotEqual
, Number
, Required
, StringValue
, Subset
classes, removing redundancies and cleaning the codebase.
Improved ValidationContext
The ValidationContext
class now includes a setAttributeLabel()
method to set the label of the current attribute being validated.
Updation of Validator
The Validator
class now sets the attribute label in the ValidationContext
object using the label provided by the LabelsProviderInterface
.
Removal of Redundant getName Methods from Test Files
The getName
method was removed from multiple testing files as well and replaced with the class name to provide a cleaner test suite.
Addition of Classes for Testing
New classes and files were added for more comprehensive testing of the DateTime
rule.
Newly Created Files for Testing
AtLeastDto.php
and ObjectWithLabelsProvider.php
were newly added to enrich our testing resources.
Removed Redundancies and Optimized Files
Several files and classes removed the redundant getName
method and optimized its functionalities increasing overall efficiency.
Files Renamed for Better Organization
File tests/Support/Rule/StubRule/StubRuleWithOptions.php
was renamed to tests/Support/Rule/StubRule/StubDumpedRule.php
for an organized codebase.
Improved Testing Context with New Methods
testSetAttributeLabel()
and testSetAttributeLabelWithTranslator()
methods were added in tests/ValidationContextTest.php
to set attribute labels for the validation context.
Removal of Redundant Methods from Rule Files
getName()
method from several rule files were removed, cleaning the codebase and increasing maintainability.
All modified and coverable lines are covered by tests :white_check_mark:
Comparison is base (
50b7046
) 94.60% compared to head (72725e1
) 94.60%. Report is 1 commits behind head on master.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.