Skip to content

Commit 06ab263

Browse files
committed
Minor reword
1 parent 3cf3035 commit 06ab263

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

service_container.rst

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -817,15 +817,13 @@ loss, enable the compiler pass in your application.
817817
Public Versus Private Services
818818
------------------------------
819819

820-
Every service defined is private by default. When a service is private,
821-
you cannot accees it directly from the container object (using
822-
``$container->get()``). As a best practice, you should only create
823-
*private* services, which will happen automatically. And also, you should
824-
*not* use the ``$container->get()`` method to fetch services, but instead
825-
use dependency injection.
820+
Every service defined is private by default. When a service is private, you
821+
cannot access it directly from the container using ``$container->get()``. As a
822+
best practice, you should only create *private* services and you should fetch
823+
services using dependency injection instead of using ``$container->get()``.
826824

827825
If you need to fetch services lazily, instead of using public services you
828-
should consider using a :ref:`service locator <service-locators>` instead.
826+
should consider using a :ref:`service locator <service-locators>`.
829827

830828
But, if you *do* need to make a service public, override the ``public``
831829
setting:

0 commit comments

Comments
 (0)