Skip to content

Conversation

@pauci
Copy link
Member

@pauci pauci commented Oct 9, 2025

This PR introduces MessageContext that allows to bundle the three message identifiers (id, causationId, correlationId) into a single value object, reducing method signature complexity from 3 parameters to 1.

The new ContextAwareMessageTrait demonstrates this pattern, and creating child messages is simplified to $context->child() instead of manually propagating identifiers.

This is a non-breaking addition - existing MessageTrait usage remains unchanged.

@coderabbitai
Copy link

coderabbitai bot commented Oct 9, 2025

Important

Review skipped

Auto reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch message-context

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.

@pauci pauci marked this pull request as ready for review October 10, 2025 13:59

namespace Lendable\Message;

final readonly class MessageContext
Copy link
Member Author

@pauci pauci Oct 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also considered naming this class MessageIdentifiers, but I wanted it to be more agnostic, so the messages don't care what it actually contains.

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.

2 participants