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

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy