removed deprecated Twig features

This commit is contained in:
Fabien Potencier 2015-02-12 10:28:59 +01:00
parent 8018d4bf6a
commit 52badd0056
3 changed files with 0 additions and 82 deletions

View File

@ -12,7 +12,6 @@
namespace Symfony\Bridge\Twig\Extension;
use Symfony\Component\Asset\Packages;
use Symfony\Component\Asset\VersionStrategy\StaticVersionStrategy;
/**
* Twig extension for the Symfony Asset component.

View File

@ -12,8 +12,6 @@
namespace Symfony\Bundle\TwigBundle\Command;
use Symfony\Bridge\Twig\Command\DebugCommand as BaseDebugCommand;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
@ -44,23 +42,4 @@ class DebugCommand extends BaseDebugCommand implements ContainerAwareInterface
{
return $this->container->get('twig');
}
/**
* {@inheritdoc}
*/
protected function configure()
{
parent::configure();
$this->setAliases(array('twig:debug'));
}
protected function execute(InputInterface $input, OutputInterface $output)
{
if (false !== strpos($input->getFirstArgument(), ':d')) {
$output->writeln('<comment>The use of "twig:debug" command is deprecated since version 2.7 and will be removed in 3.0. Use the "debug:twig" instead.</comment>');
}
parent::execute($input, $output);
}
}

View File

@ -1,60 +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\Bundle\TwigBundle\Debug;
trigger_error('The '.__NAMESPACE__.'\TimedTwigEngine class is deprecated since version 2.7 and will be removed in 3.0. Use the Twig native profiler instead.', E_USER_DEPRECATED);
use Symfony\Bundle\TwigBundle\TwigEngine;
use Symfony\Component\Templating\TemplateNameParserInterface;
use Symfony\Component\Stopwatch\Stopwatch;
use Symfony\Component\Config\FileLocatorInterface;
/**
* Times the time spent to render a template.
*
* @author Fabien Potencier <fabien@symfony.com>
*
* @deprecated since version 2.7, to be removed in 3.0. Use the Twig native profiler instead.
*/
class TimedTwigEngine extends TwigEngine
{
protected $stopwatch;
/**
* Constructor.
*
* @param \Twig_Environment $environment A \Twig_Environment instance
* @param TemplateNameParserInterface $parser A TemplateNameParserInterface instance
* @param FileLocatorInterface $locator A FileLocatorInterface instance
* @param Stopwatch $stopwatch A Stopwatch instance
*/
public function __construct(\Twig_Environment $environment, TemplateNameParserInterface $parser, FileLocatorInterface $locator, Stopwatch $stopwatch)
{
parent::__construct($environment, $parser, $locator);
$this->stopwatch = $stopwatch;
}
/**
* {@inheritdoc}
*/
public function render($name, array $parameters = array())
{
$e = $this->stopwatch->start(sprintf('template.twig (%s)', $name), 'template');
$ret = parent::render($name, $parameters);
$e->stop();
return $ret;
}
}