You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR was merged into the 6.4 branch.
Discussion
----------
[DependencyInjection] Fix env default processor with scalar node
| 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 :
```yaml
scalar_node: "%env(FOO_ENV)%"
```
to :
```yaml
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.
Commits
-------
80eb609 [DependencyInjection] Fix env default processor with scalar node
$this->expectExceptionMessageMatches('/^Invalid type for path "env_extension\.scalar_node"\. Expected one of "bool", "int", "float", "string", but got one of "int", "array"\.$/');
0 commit comments