Skip to content

Commit 968d0c1

Browse files
committed
bug #23180 [FrameworkBundle] Expose the AbstractController's container to its subclasses (BPScott)
This PR was merged into the 3.3 branch. Discussion ---------- [FrameworkBundle] Expose the AbstractController's container to its subclasses | Q | A | ------------- | --- | Branch? | 3.3 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | n/a | License | MIT | Doc PR | n/a This is useful if an application provides their own base Controller that references items in the container. It also makes it simpler for that base controller to add additional optional dependencies by only overriding getSubscribedServices instead of having to reimplement setContainer and use ControllerTrait. Commits ------- ee17131fca Expose the AbstractController's container to its subclasses
2 parents 37b8c28 + 434deb1 commit 968d0c1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Controller/AbstractController.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,10 @@ abstract class AbstractController implements ServiceSubscriberInterface
3535
{
3636
use ControllerTrait;
3737

38-
private $container;
38+
/**
39+
* @var ContainerInterface
40+
*/
41+
protected $container;
3942

4043
/**
4144
* @internal

0 commit comments

Comments
 (0)