Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ed29c03

Browse files
[HttpKernel] Keep 3.0 compat by not using ContainerAware
1 parent 7beea17 commit ed29c03

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

src/Symfony/Component/DependencyInjection/ContainerAwareTrait.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ trait ContainerAwareTrait
2424
protected $container;
2525

2626
/**
27-
* Sets the Container associated with this Controller.
27+
* Sets the Container.
2828
*
29-
* @param ContainerInterface $container A ContainerInterface instance
29+
* @param ContainerInterface|null $container A ContainerInterface instance or null
3030
*/
3131
public function setContainer(ContainerInterface $container = null)
3232
{

src/Symfony/Component/HttpKernel/Bundle/Bundle.php

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
namespace Symfony\Component\HttpKernel\Bundle;
1313

14-
use Symfony\Component\DependencyInjection\ContainerAware;
14+
use Symfony\Component\DependencyInjection\ContainerInterface;
1515
use Symfony\Component\DependencyInjection\ContainerBuilder;
1616
use Symfony\Component\DependencyInjection\Container;
1717
use Symfony\Component\Console\Application;
@@ -24,8 +24,12 @@
2424
*
2525
* @author Fabien Potencier <[email protected]>
2626
*/
27-
abstract class Bundle extends ContainerAware implements BundleInterface
27+
abstract class Bundle implements BundleInterface
2828
{
29+
/**
30+
* @var ContainerInterface
31+
*/
32+
protected $container;
2933
protected $name;
3034
protected $extension;
3135
protected $path;
@@ -58,6 +62,16 @@ public function build(ContainerBuilder $container)
5862
{
5963
}
6064

65+
/**
66+
* Sets the Container.
67+
*
68+
* @param ContainerInterface|null $container A ContainerInterface instance or null
69+
*/
70+
public function setContainer(ContainerInterface $container = null)
71+
{
72+
$this->container = $container;
73+
}
74+
6175
/**
6276
* Returns the bundle's container extension.
6377
*

0 commit comments

Comments
 (0)