Skip to content

Commit 7253f1b

Browse files
committed
Minor tweaks
1 parent 171f4f5 commit 7253f1b

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

service_container/autowiring.rst

+9-7
Original file line numberDiff line numberDiff line change
@@ -869,10 +869,10 @@ Autowiring Anonymous Services Inline
869869

870870
The ``#[AutowireInline]`` attribute was added in Symfony 7.1.
871871

872-
Similar to how one can define anonymous services inline using configuration files,
872+
Similar to how anonymous services can be defined inline in configuration files,
873873
the :class:`Symfony\\Component\\DependencyInjection\\Attribute\\AutowireInline`
874-
attribute allows declaring anonymous services inline next to their corresponding
875-
arguments::
874+
attribute allows you to declare anonymous services inline, directly next to their
875+
corresponding arguments::
876876

877877
public function __construct(
878878
#[AutowireInline(
@@ -888,11 +888,13 @@ arguments::
888888
) {
889889
}
890890

891-
As you might have already figured out, this declaration instructs Symfony to inject an
892-
object created by calling the ``ScopingHttpClient::forBaseUri()`` factory with the
893-
configured base URI and default options.
891+
This example tells Symfony to inject an object created by calling the
892+
``ScopingHttpClient::forBaseUri()`` factory with the specified base URI and
893+
default options. This is just one example: you can use the ``#[AutowireInline]``
894+
attribute to define any kind of anonymous service.
894895

895-
Of course, this is just an example and this attribute can be used to construct any kind of objects.
896+
While this approach is convenient for simple service definitions, consider moving
897+
complex or heavily configured services to a configuration file to ease maintenance.
896898

897899
Autowiring Controller Action Methods
898900
------------------------------------

0 commit comments

Comments
 (0)