Commit 06b9c31
committed
bug symfony#59262 [DependencyInjection] Fix env default processor with scalar node (tBibaut)
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 nodeFile tree
2 files changed
+78
-11
lines changed- src/Symfony/Component/DependencyInjection
- Compiler
- Tests/Compiler
2 files changed
+78
-11
lines changedLines changed: 48 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
| 52 | + | |
| 53 | + | |
63 | 54 | | |
64 | 55 | | |
65 | 56 | | |
| |||
100 | 91 | | |
101 | 92 | | |
102 | 93 | | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
103 | 140 | | |
Lines changed: 30 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
76 | 106 | | |
77 | 107 | | |
78 | 108 | | |
| |||
0 commit comments