Skip to content

Commit 434deb1

Browse files
committed
Expose the AbstractController's container to its subclasses
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.
1 parent 66934d9 commit 434deb1

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)