Skip to content

Commit eff9733

Browse files
committed
removing more scope stuff
1 parent 81c7572 commit eff9733

File tree

2 files changed

+1
-16
lines changed

2 files changed

+1
-16
lines changed

Diff for: book/service_container.rst

-14
Original file line numberDiff line numberDiff line change
@@ -884,20 +884,6 @@ Now, just inject the ``request_stack``, which behaves like any normal service:
884884
array(new Reference('request_stack'))
885885
));
886886
887-
.. sidebar:: Why not Inject the ``request`` Service?
888-
889-
Almost all Symfony2 built-in services behave in the same way: a single
890-
instance is created by the container which it returns whenever you get it or
891-
when it is injected into another service. There is one exception in a standard
892-
Symfony2 application: the ``request`` service.
893-
894-
If you try to inject the ``request`` into a service, you will probably receive
895-
a
896-
:class:`Symfony\\Component\\DependencyInjection\\Exception\\ScopeWideningInjectionException`
897-
exception. That's because the ``request`` can **change** during the life-time
898-
of a container (when a sub-request is created for instance).
899-
900-
901887
.. tip::
902888

903889
If you define a controller as a service then you can get the ``Request``

Diff for: components/dependency_injection/parentservices.rst

+1-2
Original file line numberDiff line numberDiff line change
@@ -277,8 +277,7 @@ called when the child services are instantiated.
277277

278278
.. caution::
279279

280-
The ``scope``, ``abstract`` and ``tags`` attributes are always taken
281-
from the child service.
280+
The ``abstract`` and ``tags`` attributes are always taken from the child service.
282281

283282
The parent service is abstract as it should not be directly retrieved from
284283
the container or passed into another service. It exists merely as a "template"

0 commit comments

Comments
 (0)