Skip to content

Commit ee5e28f

Browse files
committed
Tweak
1 parent bd5b9c6 commit ee5e28f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

service_container/service_subscribers_locators.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,16 +110,15 @@ in the service subscriber::
110110
that you have :ref:`autoconfigure <services-autoconfigure>` enabled. You
111111
can also manually add the ``container.service_subscriber`` tag.
112112

113-
A service locator is a PSR11 container that contains a set of services,
114-
but only instantiates them when they are actually used. Let's take a closer
115-
look at this part::
113+
A service locator is a `PSR-11 container`_ that contains a set of services,
114+
but only instantiates them when they are actually used. Consider the following code::
116115

117116
// ...
118117
$handler = $this->locator->get($commandClass);
119118

120119
return $handler->handle($command);
121120

122-
In the example above, the ``$handler`` service is only instantiated when the
121+
In this example, the ``$handler`` service is only instantiated when the
123122
``$this->locator->get($commandClass)`` method is called.
124123

125124
You can also type-hint the service locator argument with
@@ -1066,3 +1065,4 @@ Another alternative is to mock it using ``PHPUnit``::
10661065
// ...
10671066

10681067
.. _`Command pattern`: https://en.wikipedia.org/wiki/Command_pattern
1068+
.. _`PSR-11 container`: https://www.php-fig.org/psr/psr-11/

0 commit comments

Comments
 (0)