8000 [TwigBridge] remove deprecation triggered when using Twig 2.7 · symfony/symfony@c17a5b2 · GitHub
[go: up one dir, main page]

Skip to content

Commit c17a5b2

Browse files
[TwigBridge] remove deprecation triggered when using Twig 2.7
1 parent b43cfc8 commit c17a5b2

File tree

3 files changed

+25
-3
lines changed

3 files changed

+25
-3
lines changed

src/Symfony/Bridge/Twig/Extension/FormExtension.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
use Symfony\Component\Form\FormView;
1919
use Twig\Environment;
2020
use Twig\Extension\AbstractExtension;
21-
use Twig\Extension\InitRuntimeInterface;
2221
use Twig\TwigFilter;
2322
use Twig\TwigFunction;
2423
use Twig\TwigTest;
@@ -41,7 +40,7 @@ public function __construct($renderer = null)
4140
if ($renderer instanceof TwigRendererInterface) {
4241
@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);
4342
} elseif (null !== $renderer && !(\is_array($renderer) && isset($renderer[0], $renderer[1]) && $renderer[0] instanceof ContainerInterface)) {
44-
throw new \InvalidArgumentException(sprintf('Passing any arguments the constructor of %s is reserved for internal use.', __CLASS__));
43+
throw new \InvalidArgumentException(sprintf('Passing any arguments to the constructor of %s is reserved for internal use.', __CLASS__));
4544
}
4645
$this->renderer = $renderer;
4746
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <fabien@symfony.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace Symfony\Bridge\Twig\Extension;
13+
14+
use Twig\Extension\InitRuntimeInterface as TwigInitRuntimeInterface;
15+
16+
/**
17+
* @deprecated to be removed in 4.x
18+
*
19+
* @internal to be removed in 4.x
20+
*/
21+
interface InitRuntimeInterface extends TwigInitRuntimeInterface
22+
{
23+
}

src/Symfony/Component/Debug/DebugClassLoader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ public function checkAnnotations(\ReflectionClass $refl, $class)
258258
if (!isset(self::$checkedClasses[$use])) {
259259
$this->checkClass($use);
260260
}
261-
if (isset(self::$deprecated[$use]) && \strncmp($ns, \str_replace('_', '\\', $use), $len)) {
261+
if (isset(self::$deprecated[$use]) && \strncmp($ns, \str_replace('_', '\\', $use), $len) && !isset(self::$deprecated[$class])) {
262262
$type = class_exists($class, false) ? 'class' : (interface_exists($class, false) ? 'interface' : 'trait');
263263
$verb = class_exists($use, false) || interface_exists($class, false) ? 'extends' : (interface_exists($use, false) ? 'implements' : 'uses');
264264

0 commit comments

Comments
 (0)
0