Skip to content

Introduce EventManagerInterface#106

Merged
greg0ire merged 1 commit intodoctrine:2.1.xfrom
greg0ire:evmi
Jan 29, 2026
Merged

Introduce EventManagerInterface#106
greg0ire merged 1 commit intodoctrine:2.1.xfrom
greg0ire:evmi

Conversation

@greg0ire
Copy link
Copy Markdown
Member

@greg0ire greg0ire commented Jan 24, 2026

In theory, having small interfaces is great, but in practice, migrating the ORM to them would involve DNF types, which are not available with PHP 8.1, for use in e.g. the constructor of EntityManager.

    public function __construct(
        private Connection $conn,
        private Configuration $config,
-       EventManager|null $eventManager = null,
+       (EventListenerIntrospector&EventListenerRegistry&EventSubscriberRegistry)|null $eventManager = null,
    ) {

Targeting 2.1.x since this is more fixing a design blunder than an improvement.

In theory, having small interfaces is great, but in practice, migrating
the ORM to them would involve DNF types, which are not available with
PHP 8.1, for use in e.g. the constructor of EntityManager.

    public function __construct(
        private Connection $conn,
        private Configuration $config,
-       EventManager|null $eventManager = null,
+       (EventListenerIntrospector&EventListenerRegistry&EventSubscriberRegistry)|null $eventManager = null,
    ) {
@greg0ire greg0ire marked this pull request as draft January 24, 2026 13:48
@greg0ire
Copy link
Copy Markdown
Member Author

Converting to draft as I want to use this in Proof of concept ORM PRs

@greg0ire
Copy link
Copy Markdown
Member Author

Here is the PoC: doctrine/orm#12361

@greg0ire greg0ire marked this pull request as ready for review January 27, 2026 20:30
@greg0ire greg0ire added this to the 2.1.1 milestone Jan 29, 2026
@greg0ire greg0ire merged commit dda3392 into doctrine:2.1.x Jan 29, 2026
11 checks passed
@greg0ire greg0ire added the Bug Something isn't working label Jan 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants