Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork5.2k
Clarify Lazy Services usage withfinal
&readonly
classes#21065
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:7.3
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -23,8 +23,8 @@ until you interact with the proxy in some way. | ||
.. warning:: | ||
Lazy services supportfor`final`_ or ``readonly`` classes was introduced in Symfony 7.3, and | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. This is not a warning anymore, make let's move this to a versionadded 7.3 directive? | ||
requires PHP 8.4 or newer. You can use`Interface Proxifying`_ to work around this limitation. | ||
.. _lazy-services_configuration: | ||
@@ -145,9 +145,9 @@ It defines an optional parameter used to define interfaces for proxy and interse | ||
Interface Proxifying | ||
-------------------- | ||
Under the hood,lazy services leverage `lazy objects`_ since PHP 8.4 and Symfony 7.3. In earlier version, | ||
proxy objects inheriting fromthe service's class are generated. One of the limitations of proxy objects | ||
is inability to extend`final`_ or``readonly`` classes. | ||
To workaround this limitation, you can configure a proxy to only implement | ||
specific interfaces. | ||
@@ -231,4 +231,5 @@ implement multiple interfaces by adding new "proxy" tags. | ||
.. _`ghost object`: https://en.wikipedia.org/wiki/Lazy_loading#Ghost | ||
.. _`final`: https://www.php.net/manual/en/language.oop5.final.php | ||
.. _`lazy objects`: https://www.php.net/manual/en/language.oop5.lazy-objects.php | ||
.. _`proxy`: https://en.wikipedia.org/wiki/Proxy_pattern |