Support nette/mail 4 and Doctrine ORM 3 - #13
Merged
Merged
Conversation
masicek
commented
Aug 13, 2026
Collaborator
- composer: allow nette/mail ^3.1 || ^4.0, require PHP ^8.1
- use Nette\Mail\Mailer interface instead of IMailer (exists since mail 3.1 as alias target, the only name left in mail 4)
- duplicate entity mapping as PHP attributes next to annotations so it works with both the annotation driver (ORM 2) and the attribute driver (ORM 2.9+/3)
- flush via new flushEntry(): ORM 2 keeps single-entity flush() so enqueueing a mail does not write the caller's unrelated pending changes; the full flush() is used only on ORM 3, where single-entity flush was removed (detected via reflection)
- fix implicitly nullable parameter in setMessage() (deprecated since PHP 8.4)
- composer: allow nette/mail ^3.1 || ^4.0, require PHP ^8.1 - use Nette\Mail\Mailer interface instead of IMailer (exists since mail 3.1 as alias target, the only name left in mail 4) - duplicate entity mapping as PHP attributes next to annotations so it works with both the annotation driver (ORM 2) and the attribute driver (ORM 2.9+/3) - flush via new flushEntry(): ORM 2 keeps single-entity flush() so enqueueing a mail does not write the caller's unrelated pending changes; the full flush() is used only on ORM 3, where single-entity flush was removed (detected via reflection) - fix implicitly nullable parameter in setMessage() (deprecated since PHP 8.4)
Per review: the annotation driver is gone in ORM 3, so keeping the mapping duplicated in both formats only means two places to maintain. Attributes are read by the attribute driver in ORM 2.9+ as well. Projects that still read mapping with the annotation driver must switch to the attribute driver (at least for this package's namespace), so this makes the release a major one. Also declares doctrine/orm in require - it was an undeclared dependency even before this change.
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.