File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff 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
125124You 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/
You can’t perform that action at this time.
0 commit comments