File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -817,15 +817,13 @@ loss, enable the compiler pass in your application.
817817Public 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
827825If 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
830828But, if you *do * need to make a service public, override the ``public ``
831829setting:
You can’t perform that action at this time.
0 commit comments