Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Config] ParamConfigurator is not longer respected as scalar-string-value #54852

@michaljusiega

Description

@michaljusiega

Symfony version(s) affected

7.1.0-BETA1

Description

After update to BETA released version, I got an error for configuration, where ParamConfigurator is not anymore respected as scalar value.

I don't know what changes cause this issue.

How to reproduce

One of:

use Symfony\Config\FrameworkConfig;

use function Symfony\Component\DependencyInjection\Loader\Configurator\param;

return static function (FrameworkConfig $frameworkConfig): void {
    $frameworkConfig->phpErrors()
        ->log(value: param(name: 'kernel.debug'));
};

Possible Solution

Cast ParamConfigurator to string anyway, when the configuration allows you to pass an object.

use Symfony\Config\FrameworkConfig;

use function Symfony\Component\DependencyInjection\Loader\Configurator\param;

return static function (FrameworkConfig $frameworkConfig): void {
    $frameworkConfig->phpErrors()
        ->log(value: (string) param(name: 'kernel.debug'));
};

Additional Context

obraz
obraz

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions