8000 bug #58207 [TwigBridge] Avoid calling deprecated mergeGlobals() (derr… · symfony/symfony@adc87ad · GitHub
[go: up one dir, main page]

Skip to content

Commit adc87ad

Browse files
committed
bug #58207 [TwigBridge] Avoid calling deprecated mergeGlobals() (derrabus)
This PR was merged into the 5.4 branch. Discussion ---------- [TwigBridge] Avoid calling deprecated mergeGlobals() | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | Follows twigphp/Twig#4283 | License | MIT `getGlobals()` is documented as the official replacement for `mergeGlobals()` despite being flagged ``@internal``. I've left a comment on the upstream PR. Commits ------- 2883331 [TwigBridge] Avoid calling deprecated mergeGlobals()
2 parents 7518cc7 + 2883331 commit adc87ad

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Symfony/Bridge/Twig/Form/TwigRendererEngine.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,7 8000 +44,7 @@ public function renderBlock(FormView $view, $resource, string $blockName, array
4444
{
4545
$cacheKey = $view->vars[self::CACHE_KEY_VAR];
4646

47-
$context = $this->environment->mergeGlobals($variables);
47+
$context = $variables + $this->environment->getGlobals();
4848

4949
ob_start();
5050

@@ -164,7 +164,7 @@ protected function loadResourcesFromTheme(string $cacheKey, &$theme)
164164
// theme is a reference and we don't want to change it.
165165
$currentTheme = $theme;
166166

167-
$context = $this->environment->mergeGlobals([]);
167+
$context = $this->environment->getGlobals();
168168

169169
// The do loop takes care of template inheritance.
170170
// Add blocks from all templates in the inheritance tree, but avoid

0 commit comments

Comments
 (0)
0