Closed dood- closed 6 months ago
Q | A |
---|---|
Is bugfix? | ❌ |
New feature? | ✔️ |
Breaks BC? | ❌ |
Fixed issues | #633 |
Introduction of PHP Attribute for Property Labels
Label
class located in the Helper
folder.Incorporation of Label Handling in Code
ObjectParser.php
file. Moreover, the labels are appropriately incorporated into error messages with the newly introduced setLabel
and getAttributeLabel
methods in the ValidationContext.php
file.Implementation of LabelsProviderInterface in ObjectDataSet
ObjectDataSet.php
file has been updated to provide label information by implementing LabelsProviderInterface
. Validator Update for Label Usage
Validator.php
file now checks if labels are available by examining if the DataSet
implements LabelsProviderInterface
. If available, these labels are set in the validation context.Testing of New Features
ObjectParserTest.php
and ValidationContextTest.php
files to ensure the correct operation of label fetching, storing, and usage.Guide Update
configuring-rules-via-php-attributes.md
guidance document has been updated with an example showcasing the use of the Label
attribute for custom labels.Inclusion of New Interfaces and Classes
LabelsProviderInterface
, which defines the blueprint for classes that provide attribute labels.Label Demonstrations in Test Objects
ObjectForTestingCache1.php
and ObjectForTestingDisabledCache.php
files now include examples of properties having Label
attributes assigned.All these changes seek to provide greater flexibility and configurability in error messages with the help of custom property labels.
All modified and coverable lines are covered by tests :white_check_mark:
Comparison is base (
493a2d1
) 94.45% compared to head (428c142
) 94.49%. Report is 3 commits behind head on master.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
👍 overall.
👍