Skip to content

[DependencyInjection] Document proxifying interfaces for lazy services #17105

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

Merged
merged 1 commit into from
Aug 4, 2022

Conversation

tucksaun
Copy link
Contributor

@tucksaun tucksaun commented Aug 3, 2022

Symfony 4.2 introduced the possibility of lazy load services using final classes by proxyfying specific interfaces (symfony/symfony#20656), but this has not been documented yet.

Targeting 4.4 because 4.4 is the oldest maintained branch, but should I target 4.2 as this was introduced in 4.2?

Fix #10295

Symfony 4.2 introduced the possibility to lazy load services using final classes by proxyfying specific interfaces, but this has not been documented yet.
@carsonbot carsonbot added this to the 4.4 milestone Aug 3, 2022
@carsonbot carsonbot changed the title [DI] Document proxifying interfaces for lazy services [DependencyInjection] Document proxifying interfaces for lazy services Aug 3, 2022
@javiereguiluz javiereguiluz merged commit c35e9f5 into symfony:4.4 Aug 4, 2022
@javiereguiluz
Copy link
Member

Tugdual, you did right submitting this PR to 4.4 branch because we no longer merge in unmaintained branches.

Also, thanks a lot for a fantastic contribution documenting a nice feature that never got docs 👏

@tucksaun
Copy link
Contributor Author

tucksaun commented Aug 4, 2022

🙇

By the way, thank you @javiereguiluz for all those nice little tweaks that really make the documentation shines 🙏

@tucksaun tucksaun deleted the proxy-manager-proxy-interface branch August 4, 2022 15:31
@javiereguiluz
Copy link
Member

javiereguiluz commented Aug 4, 2022

While merging this into upper branches ... I reached 6.2, where we "removed" proxies in favor of "ghost objects". See https://github.com/symfony/symfony-docs/blob/6.2/service_container/lazy_services.rst

I kept your contribution about "Interface Proxifying" but I wonder if it applies to 6.2 and up because of the removal of proxies. Thanks.

@tucksaun
Copy link
Contributor Author

tucksaun commented Aug 4, 2022

TBH I only tried this feature on a Symfony 5.4 project.
But I just had a quick look at 6.2 and I see the option to define lazy as an interface name and some test cases or fixtures using the 'proxy' tag syntax.

If I get it correctly, the "proxy" vs "ghost object" is more a matter of implementation detail, which means it would more be a wording issue.
If you want I can have a deeper look about it and let you know.

@tucksaun
Copy link
Contributor Author

tucksaun commented Sep 9, 2022

@javiereguiluz I reviewed the wording in the 6.2 branch and as the rest of the document also uses proxy I think it works well enough as-is :)

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.

3 participants