Skip to content

[DI] Deprecate non-string default envs #27680

Closed
@ro0NL

Description

@ro0NL

Symfony version(s) affected: 4.1

Description
Currently it's allowed to do define a scalar value for a default env parameter, e.g. env(SOME): 1.5 (opposed to its string value"1.5") while that's not possible with real env vars (hence we added the prefix processors). It's a trap and as such I think we should deprecate non-string defaults, and force string values in 5.0.

This way we can safely imply a default string:... processor again, and cast to i.e. float using its dedicated float:... processor. It was reverted in #27470 to preserve BC (see #27455), but i tend to agree with @stof in #27470 (comment) this is not correct.

cc @nicolas-grekas

edit: this also requires to forbid setting prefixed defaults, which is possible today but not handled as such. I'd keep this possibility closed until then... today those are silently ignored.

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