Remove deprecated ContainerAware class and make use of the trait in another class

This commit is contained in:
Tobias Schultze 2015-11-01 17:29:50 +01:00
parent 52c50e3b1e
commit e337ce6bf7
3 changed files with 2 additions and 51 deletions

View File

@ -12,7 +12,7 @@
namespace Symfony\Bridge\Doctrine;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\DependencyInjection\ContainerAwareTrait;
use Doctrine\Common\Persistence\AbstractManagerRegistry;
/**
@ -22,10 +22,7 @@ use Doctrine\Common\Persistence\AbstractManagerRegistry;
*/
abstract class ManagerRegistry extends AbstractManagerRegistry implements ContainerAwareInterface
{
/**
* @var ContainerInterface
*/
protected $container;
use ContainerAwareTrait;
/**
* {@inheritdoc}
@ -42,12 +39,4 @@ abstract class ManagerRegistry extends AbstractManagerRegistry implements Contai
{
$this->container->set($name, null);
}
/**
* {@inheritdoc}
*/
public function setContainer(ContainerInterface $container = null)
{
$this->container = $container;
}
}

View File

@ -1,37 +0,0 @@
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\DependencyInjection;
/**
* A simple implementation of ContainerAwareInterface.
*
* @author Fabien Potencier <fabien@symfony.com>
*
* @deprecated since version 2.8, to be removed in 3.0. Use the ContainerAwareTrait instead.
*/
abstract class ContainerAware implements ContainerAwareInterface
{
/**
* @var ContainerInterface
*/
protected $container;
/**
* Sets the Container associated with this Controller.
*
* @param ContainerInterface $container A ContainerInterface instance
*/
public function setContainer(ContainerInterface $container = null)
{
$this->container = $container;
}
}

View File

@ -11,7 +11,6 @@
namespace Symfony\Component\HttpKernel\Bundle;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerAwareTrait;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Container;