Skip to content

Support nette/mail 4 and Doctrine ORM 3 - #13

Merged
thorewi merged 2 commits into
masterfrom
nette-mail-4
Aug 13, 2026
Merged

Support nette/mail 4 and Doctrine ORM 3#13
thorewi merged 2 commits into
masterfrom
nette-mail-4

Conversation

@masicek

@masicek masicek commented Aug 13, 2026

Copy link
Copy Markdown
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.
@thorewi
thorewi merged commit 2cd50fb into master Aug 13, 2026
1 check passed
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