8000 Minor tweaks · githubfromgui/symfony-docs@37cb398 · GitHub
[go: up one dir, main page]

Skip to content

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 37cb398

Browse files
committed
Minor tweaks
1 parent c35e9f5 commit 37cb398

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

service_container/lazy_services.rst

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ until you interact with the proxy in some way.
2525

2626
.. caution::
2727

28-
Lazy services do not support `final`_ classes. You can use `Interface
29-
Proxifying`_ to work around this limitation.
28+
Lazy services do not support `final`_ classes, but you can use
29+
`Interface Proxifying`_ to work around this limitation.
3030

3131
In PHP versions prior to 8.0 lazy services do not support parameters with
3232
default values for built-in PHP classes (e.g. ``PDO``).
@@ -105,10 +105,10 @@ Interface Proxifying
105105
--------------------
106106

107107
Under the hood, proxies generated to lazily load services inherit from the class
108-
used by the service. But sometimes this is not possible at all (`final`_ classes
109-
can not be extended for example) or not convenient.
108+
used by the service. However, sometimes this is not possible at all (e.g. because
109+
the class is `final`_ and can not be extended) or not convenient.
110110

111-
To workaround this limitation, you can configure a proxy to only implements
111+
To workaround this limitation, you can configure a proxy to only implement
112112
specific interfaces.
113113

114114
.. versionadded:: 4.2
@@ -164,17 +164,17 @@ specific interfaces.
164164
};
165165
166166
The virtual `proxy`_ injected into other services will only implement the
167-
specified interfaces and will not extend the original service class allowing to
168-
lazy load service using `final`_ classes. You can configure the proxy to
169-
implement multiple interfaces by repeating the "proxy" tag.
167+
specified interfaces and will not extend the original service class, allowing to
168+
lazy load services using `final`_ classes. You can configure the proxy to
169+
implement multiple interfaces by adding new "proxy" tags.
170170

171171
.. tip::
172172

173-
This features can also act as a "safe guard". Because the proxy does not
174-
extends the original class, only the methods defined by the interfaces can
175-
be called, preventing to call implementation specific one. It also prevents
176-
injecting the dependency at all if you type hinted a concrete implementation
177-
instead of the interface.
173+
This feature can also act as a safe guard: given that the proxy does not
174+
extend the original class, only the methods defined by the interface can
175+
be called, preventing to call implementation specific methods. It also
176+
prevents injecting the dependency at all if you type-hinted a concrete
177+
implementation instead of the interface.
178178

179179
Additional Resources
180180
--------------------

0 commit comments

Comments
 (0)
0