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

support PSR-11 compatible DI containers #844

Merged
merged 1 commit into from
Nov 30, 2017

Conversation

xabbuh
Copy link
Contributor

@xabbuh xabbuh commented Nov 24, 2017

Q A
Bug fix? no
New feature? yes
Doc updated no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets
License Apache-2.0

To be able to use lazily-loaded event dispatchers even with private services in JMSSerializerBundle we can leverage the ServiceLocator feature introduced in Symfony 3.3. However, that class does not depend on the ContainerInterface from the DI component, but just needs an arbitrary PSR-11 compatible ContainerInterface implementation (which the Symfony containers implements too since Symfony 3.3). The same applies to the LazyHandlerRegistry.

@goetas
Copy link
Collaborator

goetas commented Nov 24, 2017

HI! nice! thanks a lot for the PR!

I was reading https://symfony.com/blog/new-in-symfony-3-3-service-locators but I really did not get how it works... it looks that the ServiceLocator is just a service factory with visibility only on a specific subset of services... am I right?

@goetas
Copy link
Collaborator

goetas commented Nov 24, 2017

Do you mind add psr/container in the require-dev section and add some basic test? this should be the right place?

@xabbuh
Copy link
Contributor Author

xabbuh commented Nov 27, 2017

@goetas Tests added, do I need to update the changelog file too? Oh and I also updated the branch alias as I think that this change qualifies as a new feature.

@goetas
Copy link
Collaborator

goetas commented Nov 27, 2017

to me looks just great! 🕺
will check it soon and merge it!
no worries for the changelog, is automatically generated

@goetas goetas self-assigned this Nov 27, 2017
@goetas goetas merged commit 3c5550c into schmittjoh:master Nov 30, 2017
@goetas
Copy link
Collaborator

goetas commented Nov 30, 2017

thanks!

@xabbuh xabbuh deleted the psr-11-compat branch November 30, 2017 09:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants