chore: Cherry-pick address Validator subclass work onto develop - #325
Merged
Conversation
`Validator\Generic` now extends `Nails\Common\Factory\Service\FormValidation\Validator` and declares its rules in `rules()`, so country-specific validators can extend or override them and the rule set can be unit tested directly. The static `validate(Address, array)` interface method is unchanged. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> (cherry picked from commit aee49d8)
Exercises the required fields, line lengths, the ISO country check, merging extra rules, and the static `validate(Address)` interface. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> (cherry picked from commit 44c0930)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Cherry-picks the
Validatorsubclass migration fromfeature/pre-new-admin, depends on nails/common#558 (addsValidator::addRules()/overridablerules()).556a6bd(aee49d8) refactor: Make the address validator aValidatorsubclassf9d60df(44c0930) test: CoverValidator\GenericConflicts
None — both commits applied cleanly.
Verification
(against
nails/common'schore/cherry-pick-form-validationbranch synced intovendor/nails/common)PRIVATE_KEY=abc123 ./vendor/bin/phpunit: 41 tests (6 new, all passing with real assertions), 34 pre-existing incomplete tests unchanged fromdevelopbaseline.phpstan: 2 errors vs. 1 ondevelopbaseline. The extra one (Unsafe usage of new static()insrc/Validator/Generic.php:40) is not a regression — it's the same finding already present onfeature/pre-new-adminitself, just newly visible now the code exists on this branch.Do not merge yet — holding for review.
🤖 Generated with Claude Code