Skip to content

Added 'NameHandler' for the Name module with tests.#322

Merged
AlexSkrypnyk merged 1 commit intomasterfrom
feature/name-handler
Apr 16, 2026
Merged

Added 'NameHandler' for the Name module with tests.#322
AlexSkrypnyk merged 1 commit intomasterfrom
feature/name-handler

Conversation

@AlexSkrypnyk
Copy link
Copy Markdown
Collaborator

Iterates on #269 by @sensespidey. Thank you for the contribution!

Summary

  • Added NameHandler for the Name module, properly extending AbstractHandler rather than implementing FieldHandlerInterface directly.
  • Supports all six name components: title, given, middle, family, generational, and credentials.
  • Handles string shorthand ("Family, Given"), named array keys, and positional (numeric index) array keys.
  • Added NameHandlerTest with a data provider covering all input formats and multi-value scenarios.

Changes

  • src/Drupal/Driver/Fields/Drupal8/NameHandler.php - new handler.
  • tests/Drupal/Tests/Driver/NameHandlerTest.php - unit tests.

Test plan

  • String shorthand "Doe, John" maps family and given correctly.
  • String with no comma maps family only (given is null).
  • Named keys (given, family, middle, etc.) pass through as-is.
  • Numeric indices map positionally to title, given, middle, family, generational, credentials.
  • Multiple values in a single call are each expanded independently.
  • Existing unit tests pass: composer test.

…dule with tests.

Co-authored-by: Derek Laventure <derek@consensus.enterprises>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 16, 2026

Warning

Rate limit exceeded

@AlexSkrypnyk has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 15 minutes and 31 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 15 minutes and 31 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 6c09370e-6553-447a-9a38-b707b19bc8f2

📥 Commits

Reviewing files that changed from the base of the PR and between f027ecd and 3c22e70.

📒 Files selected for processing (2)
  • src/Drupal/Driver/Fields/Drupal8/NameHandler.php
  • tests/Drupal/Tests/Driver/NameHandlerTest.php
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/name-handler

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@AlexSkrypnyk AlexSkrypnyk merged commit 61e33d9 into master Apr 16, 2026
6 checks passed
@AlexSkrypnyk AlexSkrypnyk deleted the feature/name-handler branch April 16, 2026 22:25
@AlexSkrypnyk AlexSkrypnyk added this to the 2.5 milestone Apr 17, 2026
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