Skip to content

Conversation

tBibaut
Copy link
Contributor

@tBibaut tBibaut commented Dec 19, 2024

Q A
Branch? 6.4
Bug fix? yes
New feature? no
Deprecations? no
Issues
License MIT

When a default processor was used, the provided type was bool|int|float|string|array
It was too wide when validated by a scalarNode.

For example, switching a config from :

scalar_node: "%env(FOO_ENV)%"

to :

scalar_node: "%env(default:foo_param:FOO_ENV)%"

Would throw this exception :

[Symfony\Component\Config\Definition\Exception\InvalidTypeException]         
 Invalid type for path "scalar_node". Expected one of "bool", "int", "float", "string", but got one of "bool", "int", "float", "string", "array".    

This fix narrows the provided type to the combination of the parameter and the environment variable types.

@tBibaut tBibaut force-pushed the fix/default-env-processor branch from 72564bc to 27d2c96 Compare December 19, 2024 14:09
@fabpot
Copy link
Member

fabpot commented Feb 7, 2025

Thank you @tBibaut.

@fabpot fabpot merged commit 06b9c31 into symfony:6.4 Feb 7, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants