Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add abstract manager registry supporting PSR-11 ContainerInterface #58

Open
alcaeus opened this issue Apr 23, 2019 · 0 comments
Open

Add abstract manager registry supporting PSR-11 ContainerInterface #58

alcaeus opened this issue Apr 23, 2019 · 0 comments
Labels
Enhancement New feature or request

Comments

@alcaeus
Copy link
Member

alcaeus commented Apr 23, 2019

The current AbstractManagerRegistry implementation provides abstract getService and resetService methods to allow subclasses to implement their own logic how to retrieve connection and manager services. However, with PSR-11 defining a lightweight container interface, I believe it's best to deprecate AbstractManagerRegistry in favour of a ContainerManagerRegistry that takes a ContainerInterface in the constructor and forwards all calls to the ContainerInterface::get.

A basic example implementation for this would be the ManagerRegistry provided in the Symfony DoctrineBridge: https://github.com/symfony/symfony/blob/master/src/Symfony/Bridge/Doctrine/ManagerRegistry.php. There is some dark magic going on with resetService, where we'd have to discuss how to best solve this. Not sure why we need resetting services, but again, this shouldn't be an implementation detail of an abstract registry.

This new class could be added in 1.2 with the AbstractManagerRegistry potentially being deprecated in either the same release or in a subsequent 2.x release.

@Ocramius Ocramius added the Enhancement New feature or request label May 27, 2019
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

No branches or pull requests

2 participants