Skip to content

Commit

Permalink
[TwigBridge] remove deprecation triggered when using Twig 2.7
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-grekas committed Mar 10, 2019
1 parent b43cfc8 commit 65a5ba9
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
3 changes: 1 addition & 2 deletions src/Symfony/Bridge/Twig/Extension/FormExtension.php
Expand Up @@ -18,7 +18,6 @@
use Symfony\Component\Form\FormView;
use Twig\Environment;
use Twig\Extension\AbstractExtension;
use Twig\Extension\InitRuntimeInterface;
use Twig\TwigFilter;
use Twig\TwigFunction;
use Twig\TwigTest;
Expand All @@ -41,7 +40,7 @@ public function __construct($renderer = null)
if ($renderer instanceof TwigRendererInterface) {
@trigger_error(sprintf('Passing a Twig Form Renderer to the "%s" constructor is deprecated since Symfony 3.2 and won\'t be possible in 4.0. Pass the Twig\Environment to the TwigRendererEngine constructor instead.', static::class), E_USER_DEPRECATED);
} elseif (null !== $renderer && !(\is_array($renderer) && isset($renderer[0], $renderer[1]) && $renderer[0] instanceof ContainerInterface)) {
throw new \InvalidArgumentException(sprintf('Passing any arguments the constructor of %s is reserved for internal use.', __CLASS__));
throw new \InvalidArgumentException(sprintf('Passing any arguments to the constructor of %s is reserved for internal use.', __CLASS__));
}
$this->renderer = $renderer;
}
Expand Down
22 changes: 22 additions & 0 deletions src/Symfony/Bridge/Twig/Extension/InitRuntimeInterface.php
@@ -0,0 +1,22 @@
<?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\Bridge\Twig\Extension;

use Twig\Extension\InitRuntimeInterface as TwigInitRuntimeInterface;

/**
* @deprecated to be removed in 4.x
* @internal to be removed in 4.x
*/
interface InitRuntimeInterface extends TwigInitRuntimeInterface
{
}

0 comments on commit 65a5ba9

Please sign in to comment.