@@ -44,11 +44,13 @@ processor to turn the value of the ``HTTP_PORT`` env var into an integer:
4444 ..code-block ::php
4545
4646 // config/packages/framework.php
47- $container->loadFromExtension('framework', [
48- 'router' => [
49- 'http_port' => '%env(int:HTTP_PORT)%',
50- ],
51- ]);
47+ use Symfony\Config\FrameworkConfig;
48+
49+ return static function (FrameworkConfig $framework) {
50+ $framework->router()
51+ ->httpPort('%env(int:HTTP_PORT)%')
52+ ;
53+ };
5254
5355 Built-In Environment Variable Processors
5456----------------------------------------
@@ -90,10 +92,13 @@ Symfony provides the following env var processors:
9092 ..code-block ::php
9193
9294 // config/packages/framework.php
93- $container->setParameter('env(SECRET)', 'some_secret');
94- $container->loadFromExtension('framework', [
95- 'secret' => '%env(string:SECRET)%',
96- ]);
95+ use Symfony\Component\DependencyInjection\ContainerBuilder;
96+ use Symfony\Config\FrameworkConfig;
97+
98+ return static function (ContainerBuilder $container, FrameworkConfig $framework) {
99+ $container->setParameter('env(SECRET)', 'some_secret');
100+ $framework->secret('%env(string:SECRET)%');
101+ };
97102
98103 ``env(bool:FOO) ``
99104 Casts ``FOO `` to a bool (``true `` values are ``'true' ``, ``'on' ``, ``'yes' ``
@@ -131,10 +136,13 @@ Symfony provides the following env var processors:
131136 ..code-block ::php
132137
133138 // config/packages/framework.php
134- $container->setParameter('env(HTTP_METHOD_OVERRIDE)', 'true');
135- $container->loadFromExtension('framework', [
136- 'http_method_override' => '%env(bool:HTTP_METHOD_OVERRIDE)%',
137- ]);
139+ use Symfony\Component\DependencyInjection\ContainerBuilder;
140+ use Symfony\Config\FrameworkConfig;
141+
142+ return static function (ContainerBuilder $container, FrameworkConfig $framework) {
143+ $container->setParameter('env(HTTP_METHOD_OVERRIDE)', 'true');
144+ $framework->httpMethodOverride('%env(bool:HTTP_METHOD_OVERRIDE)%');
145+ };
138146
139147 ``env(not:FOO) ``
140148
@@ -269,10 +277,13 @@ Symfony provides the following env var processors:
269277 ..code-block ::php
270278
271279 // config/packages/framework.php
272- $container->setParameter('env(TRUSTED_HOSTS)', '["10.0.0.1", "10.0.0.2"]');
273- $container->loadFromExtension('framework', [
274- 'trusted_hosts' => '%env(json:TRUSTED_HOSTS)%',
275- ]);
280+ use Symfony\Component\DependencyInjection\ContainerBuilder;
281+ use Symfony\Config\FrameworkConfig;
282+
283+ return static function (ContainerBuilder $container, FrameworkConfig $framework) {
284+ $container->setParameter('env(TRUSTED_HOSTS)', '["10.0.0.1", "10.0.0.2"]');
285+ $framework->trustedHosts('%env(json:TRUSTED_HOSTS)%');
286+ };
276287
277288 ``env(resolve:FOO) ``
278289 If the content of ``FOO `` includes container parameters (with the syntax
@@ -353,10 +364,13 @@ Symfony provides the following env var processors:
353364 ..code-block ::php
354365
355366 // config/packages/framework.php
356- $container->setParameter('env(TRUSTED_HOSTS)', '10.0.0.1,10.0.0.2');
357- $container->loadFromExtension('framework', [
358- 'trusted_hosts' => '%env(csv:TRUSTED_HOSTS)%',
359- ]);
367+ use Symfony\Component\DependencyInjection\ContainerBuilder;
368+ use Symfony\Config\FrameworkConfig;
369+
370+ return static function (ContainerBuilder $container, FrameworkConfig $framework) {
371+ $container->setParameter('env(TRUSTED_HOSTS)', '10.0.0.1,10.0.0.2');
372+ $framework->trustedHosts('%env(csv:TRUSTED_HOSTS)%');
373+ };
360374
361375 ``env(file:FOO) ``
362376 Returns the contents of a file whose path is the value of the ``FOO `` env var: