Skip to content

PHP configuration not showing equivalent to when@dev #21510

@GromNaN

Description

@GromNaN

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',
            ],
        ],
    ],
]);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions