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::
110
110
that you have :ref: `autoconfigure <services-autoconfigure >` enabled. You
111
111
can also manually add the ``container.service_subscriber `` tag.
112
112
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::
116
115
117
116
// ...
118
117
$handler = $this->locator->get($commandClass);
119
118
120
119
return $handler->handle($command);
121
120
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
123
122
``$this->locator->get($commandClass) `` method is called.
124
123
125
124
You can also type-hint the service locator argument with
@@ -1066,3 +1065,4 @@ Another alternative is to mock it using ``PHPUnit``::
1066
1065
// ...
1067
1066
1068
1067
.. _`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