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

Skip to content

Commit 07f90a6

Browse files
committed
ContainerAware class is deprecated since 3.0
We cannot deprecate it in 2.8 as the alternative, the trait, cannot be used with php 5.3. So there would not be an upgrade path for people using an older php version
1 parent 1b3f579 commit 07f90a6

File tree

2 files changed

+3
-13
lines changed

2 files changed

+3
-13
lines changed

src/Symfony/Bridge/Doctrine/ManagerRegistry.php

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespace Symfony\Bridge\Doctrine;
1313

1414
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
15+
use Symfony\Component\DependencyInjection\ContainerAwareTrait;
1516
use Symfony\Component\DependencyInjection\ContainerInterface;
1617
use Doctrine\Common\Persistence\AbstractManagerRegistry;
1718

@@ -22,10 +23,7 @@
2223
*/
2324
abstract class ManagerRegistry extends AbstractManagerRegistry implements ContainerAwareInterface
2425
{
25-
/**
26-
* @var ContainerInterface
27-
*/
28-
protected $container;
26+
use ContainerAwareTrait;
2927

3028
/**
3129
* {@inheritdoc}
@@ -42,12 +40,4 @@ protected function resetService($name)
4240
{
4341
$this->container->set($name, null);
4442
}
45-
46-
/**
47-
* {@inheritdoc}
48-
*/
49-
public function setContainer(ContainerInterface $container = null)
50-
{
51-
$this->container = $container;
52-
}
5343
}

src/Symfony/Component/DependencyInjection/ContainerAware.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*
1717
* @author Fabien Potencier <[email protected]>
1818
*
19-
* @deprecated Deprecated since version 2.7, to be removed in 3.0. Use ContainerAwareTrait with ContainerAwareInterface instead.
19+
* @deprecated since version 3.0, to be removed in 4.0. Use ContainerAwareTrait with ContainerAwareInterface instead.
2020
*/
2121
abstract class ContainerAware implements ContainerAwareInterface
2222
{

0 commit comments

Comments
 (0)