8000 feature #50883 [TwigBundle] Allow omitting the `autoescape_service_me… · andersmateusz/symfony@3688c1b · GitHub
[go: up one dir, main page]

Skip to content

Commit 3688c1b

Browse files
committed
feature symfony#50883 [TwigBundle] Allow omitting the autoescape_service_method option when autoescape_service is set to an invokable service id (nicolas-grekas)
This PR was merged into the 6.4 branch. Discussion ---------- [TwigBundle] Allow omitting the `autoescape_service_method` option when `autoescape_service` is set to an invokable service id | Q | A | ------------- | --- | Branch? | 6.4 | Bug fix? | no | New feature? | yes | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - Commits ------- d3b3d28 [TwigBundle] Allow omitting the `autoescape_service_method` option when `autoescape_service` is set to an invokable service id
2 parents 6a65ebd + d3b3d28 commit 3688c1b

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/Symfony/Bundle/TwigBundle/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
CHANGELOG
22
=========
33

4+
6.4
5+
---
6+
7+
* Allow omitting the `autoescape_service_method` option when `autoescape_service` is set to an invokable service id
8+
49
6.3
510
---
611

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,8 @@ public function load(array $configs, ContainerBuilder $container)
151151
}
152152
}
153153
< 64CC br>
154-
if (isset($config['autoescape_service']) && isset($config['autoescape_service_method'])) {
155-
$config['autoescape'] = [new Reference($config['autoescape_service']), $config['autoescape_service_method']];
154+
if (isset($config['autoescape_service'])) {
155+
$config['autoescape'] = [new Reference($config['autoescape_service']), $config['autoescape_service_method'] ?? '__invoke'];
156156
}
157157

158158
$container->getDefinition('twig')->replaceArgument(1, array_intersect_key($config, [

0 commit comments

Comments
 (0)
0