symfony / symfony-docs

The Symfony documentation

Home Page:https://symfony.com/doc

Repository from Github https://github.comsymfony/symfony-docsRepository from Github https://github.comsymfony/symfony-docs

PHP configuration not showing equivalent to `when@dev`

GromNaN opened this issue · comments

This mailer configuration example is non equivalent to the Yaml config.

symfony-docs/mailer.rst

Lines 2102 to 2106 in 50f1f4d

return static function (FrameworkConfig $framework): void {
// ...
$framework->mailer()
->dsn('null://null');
};

It should be like this:

return static function (WebpackEncoreConfig $webpackEncore, ContainerConfigurator $container): void {
$webpackEncore
->outputPath('%kernel.project_dir%/public/build')
->strictMode(true)
->cache(false)
;
// cache is enabled only in the "prod" environment
if ('prod' === $container->env()) {
$webpackEncore->cache(true);
}
// disable strict mode only in the "test" environment
if ('test' === $container->env()) {
$webpackEncore->strictMode(false);
}

The new syntax

namespace Symfony\Config;

return new FrameworkConfig([
    'when@dev' =>
        'framework' => [
            'mailer' => [
                'dsn' => 'null://null',
            ],
        ],
    ],
]);