Skip to content

feat: support for custom message generation in ZddMessageConfigInterface - #44

Merged
B-Galati merged 6 commits into
mainfrom
custom-object
Jan 23, 2026
Merged

B-Galati merged 6 commits into
mainfrom
custom-object

Conversation

@B-Galati

@B-Galati B-Galati commented Nov 21, 2025 •

Copy link
Copy Markdown
Contributor

This PR introduces optional custom message generation through a new CustomMessageGeneratorInterface,
allowing users to have full control over how specific message instances are created.

Changes

  • Added CustomMessageGeneratorInterface with generateCustomMessage() method
  • Extracted MessageGenerator class to centralize message creation logic
  • Updated ZddMessageFactory to delegate message generation to MessageGenerator
  • Added documentation and example usage in README

Notes

  • CustomMessageGeneratorInterface is optional and separate from ZddMessageConfigInterface
  • Users can implement both interfaces in the same class if they need custom instantiation
  • Custom message instantiation is useful when the default reflection-based approach is insufficient or when
    messages require specific constructor logic

@B-Galati B-Galati self-assigned this Nov 21, 2025
@B-Galati B-Galati added the enhancement New feature or request label Nov 21, 2025
Comment thread src/Factory/ZddMessageFactory.php Resolved
Comment thread README.md Resolved
@ismail1432

Copy link
Copy Markdown
Collaborator

Where Am I? 😭

Capture d’écran 2025-11-21 à 16 33 54

@B-Galati

B-Galati commented Nov 21, 2025 •

Copy link
Copy Markdown
Contributor Author

Where Am I? 😭

@ismail1432 You already did the review, that's why you are not listed anymore 👍

@ismail1432 ismail1432 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM! TY @B-Galati

@B-Galati
B-Galati force-pushed the custom-object branch 3 times, most recently from 704d9d4 to cd5a217 Compare November 24, 2025 13:00
@B-Galati
B-Galati requested a review from ismail1432 November 24, 2025 13:03
@B-Galati

Copy link
Copy Markdown
Contributor Author

I just pushed some new changes that introduces the class MessageGenerator. Read the description for more information about it 👍

I did it for 2 main reasons:

  1. MessageGenerator will be used directly in Yousign codebase
  2. it makes the code base clearer by segregating responsabilities

This refacto will clearly split responsibilities between these 2 concerns.
Moreover, it will enable the introduction of the custom message feature to handle edge cases.
Comment thread src/Factory/Property.php Resolved

@TBoileau TBoileau left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Thanks for the work !

@B-Galati B-Galati changed the title feat: support for custom message generation in `ZddMessageConfigInterface feat: support for custom message generation in ZddMessageConfigInterface Dec 19, 2025
@B-Galati

Copy link
Copy Markdown
Contributor Author

The new interface is marked as experimental after discussion with @Inkod.

And we also added some warning about nullable cases that can hide ZDD problems for custom messages.

@B-Galati
B-Galati merged commit e84f180 into main Jan 23, 2026
8 checks passed
@B-Galati
B-Galati deleted the custom-object branch January 23, 2026 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants