Skip to content

chore: Cherry-pick address Validator subclass work onto develop - #325

Merged
hellopablo merged 2 commits into
developfrom
chore/cherry-pick-form-validation
Sep 6, 2026
Merged

chore: Cherry-pick address Validator subclass work onto develop#325
hellopablo merged 2 commits into
developfrom
chore/cherry-pick-form-validation

Conversation

@hellopablo

Copy link
Copy Markdown
Member

Summary

Cherry-picks the Validator subclass migration from feature/pre-new-admin, depends on nails/common#558 (adds Validator::addRules()/overridable rules()).

  • 556a6bd (aee49d8) refactor: Make the address validator a Validator subclass
  • f9d60df (44c0930) test: Cover Validator\Generic

Conflicts

None — both commits applied cleanly.

Verification

(against nails/common's chore/cherry-pick-form-validation branch synced into vendor/nails/common)

  • PRIVATE_KEY=abc123 ./vendor/bin/phpunit: 41 tests (6 new, all passing with real assertions), 34 pre-existing incomplete tests unchanged from develop baseline.
  • phpstan: 2 errors vs. 1 on develop baseline. The extra one (Unsafe usage of new static() in src/Validator/Generic.php:40) is not a regression — it's the same finding already present on feature/pre-new-admin itself, just newly visible now the code exists on this branch.

Do not merge yet — holding for review.

🤖 Generated with Claude Code

hellopablo and others added 2 commits September 6, 2026 20:15
`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)
@hellopablo
hellopablo merged commit 4f53d56 into develop Sep 6, 2026
4 of 7 checks passed
@hellopablo
hellopablo deleted the chore/cherry-pick-form-validation branch September 6, 2026 20:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant