Deprecate Environment::mergeGlobals()

This commit is contained in:
Fabien Potencier
2024-09-07 14:00:41 +02:00
parent e1b64b1937
commit b86575cfd6
8 changed files with 30 additions and 19 deletions
+2 -2
View File
@@ -57,12 +57,12 @@ final class TemplateWrapper
public function renderBlock(string $name, array $context = []): string
{
return $this->template->renderBlock($name, $this->env->mergeGlobals($context));
return $this->template->renderBlock($name, $context + $this->env->getGlobals());
}
public function displayBlock(string $name, array $context = [])
{
$context = $this->env->mergeGlobals($context);
$context += $this->env->getGlobals();
foreach ($this->template->yieldBlock($name, $context) as $data) {
echo $data;
}