Skip to content

Commit 31d13c5

Browse files
committed
minor #11993 When overriding session service definition, make it public (pbowyer)
This PR was merged into the 4.2 branch. Discussion ---------- When overriding `session` service definition, make it public `Symfony\Bundle\FrameworkBundle\Controller\ControllerTrait::addFlash()` relies on getting the `session` service from the service container. Since 3.4 services defined in `services.yaml` are private by default. When overriding the `session` service definition, it has to be explicitly marked as public. The 4.2 documentation branch was the earliest I found containing this example service definition. Commits ------- 315103f When overriding `session` service definition, make it public
2 parents fcca521 + 315103f commit 31d13c5

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

session.rst

+1
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ the default ``AttributeBag`` by the ``NamespacedAttributeBag``:
180180
181181
# config/services.yaml
182182
session:
183+
public: true
183184
class: Symfony\Component\HttpFoundation\Session\Session
184185
arguments: ['@session.storage', '@session.namespacedattributebag', '@session.flash_bag']
185186

0 commit comments

Comments
 (0)