Skip to content

Commit 6b8fad9

Browse files
committed
Remove legacy Twig_ namespace support
1 parent 04e6833 commit 6b8fad9

File tree

5 files changed

+4
-9
lines changed

5 files changed

+4
-9
lines changed

src/Symfony/Bridge/Twig/DataCollector/TwigDataCollector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ public function getHtmlCallGraph(): Markup
131131

132132
public function getProfile(): Profile
133133
{
134-
return $this->profile ??= unserialize($this->data['profile'], ['allowed_classes' => ['Twig_Profiler_Profile', Profile::class]]);
134+
return $this->profile ??= unserialize($this->data['profile'], ['allowed_classes' => [Profile::class]]);
135135
}
136136

137137
private function getComputedData(string $index): mixed

src/Symfony/Bridge/Twig/Tests/Node/TransNodeTest.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,6 @@ protected function getVariableGetterWithoutStrictCheck($name)
5050

5151
protected function getVariableGetterWithStrictCheck($name)
5252
{
53-
if (Environment::MAJOR_VERSION >= 2) {
54-
return sprintf('(isset($context["%1$s"]) || array_key_exists("%1$s", $context) ? $context["%1$s"] : (function () { throw new %2$s(\'Variable "%1$s" does not exist.\', 0, $this->source); })())', $name, Environment::VERSION_ID >= 20700 ? 'RuntimeError' : 'Twig_Error_Runtime');
55-
}
56-
57-
return sprintf('($context["%s"] ?? $this->getContext($context, "%1$s"))', $name);
53+
return sprintf('(isset($context["%1$s"]) || array_key_exists("%1$s", $context) ? $context["%1$s"] : (function () { throw new RuntimeError(\'Variable "%1$s" does not exist.\', 0, $this->source); })())', $name);
5854
}
5955
}

src/Symfony/Bundle/TwigBundle/DependencyInjection/TwigExtension.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,6 @@ public function load(array $configs, ContainerBuilder $container): void
170170
'optimizations' => true,
171171
]));
172172

173-
$container->registerForAutoconfiguration(\Twig_ExtensionInterface::class)->addTag('twig.extension');
174-
$container->registerForAutoconfiguration(\Twig_LoaderInterface::class)->addTag('twig.loader');
175173
$container->registerForAutoconfiguration(ExtensionInterface::class)->addTag('twig.extension');
176174
$container->registerForAutoconfiguration(LoaderInterface::class)->addTag('twig.loader');
177175
$container->registerForAutoconfiguration(RuntimeExtensionInterface::class)->addTag('twig.runtime');

src/Symfony/Component/VarDumper/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ CHANGELOG
66

77
* Add argument `$label` to `VarDumper::dump()`
88
* Require explicit argument when calling `VarDumper::setHandler()`
9+
* Remove display of backtrace in `Twig_Template`, only `Twig\Template` are supported
910

1011
6.4
1112
---

src/Symfony/Component/VarDumper/Caster/ExceptionCaster.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ public static function castFrameStub(FrameStub $frame, array $a, Stub $stub, boo
214214
$ellipsis = $ellipsis->attr['ellipsis'] ?? 0;
215215

216216
if (is_file($f['file']) && 0 <= self::$srcContext) {
217-
if (!empty($f['class']) && (is_subclass_of($f['class'], 'Twig\Template') || is_subclass_of($f['class'], 'Twig_Template')) && method_exists($f['class'], 'getDebugInfo')) {
217+
if (!empty($f['class']) && is_subclass_of($f['class'], 'Twig\Template') && method_exists($f['class'], 'getDebugInfo')) {
218218
$template = null;
219219
if (isset($f['object'])) {
220220
$template = $f['object'];

0 commit comments

Comments
 (0)