Skip to content

Commit 883b7b0

Browse files
committed
Remove legacy Twig_ namespace support
1 parent 73cf0c0 commit 883b7b0

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

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

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
}

0 commit comments

Comments
 (0)