Commit a30f387
committed
feature symfony#51273 [Config] Add
This PR was merged into the 7.4 branch.
Discussion
----------
[Config] Add `ArrayNodeDefinition::acceptAndWrap()` to list alternative types that should be accepted and wrapped in an array
| Q | A
| ------------- | ---
| Branch? | 6.4
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
With symfony#58450, we lost some type info when generating config builders, by preventing symfony#44166 to work correctly.
This PR improves the description of config trees by adding an `ArrayNodeDefinition::acceptAndWrap()` method that allows one to declare which alternative types should be accepted at array-node levels. This declaration then triggers the wrapping of such cases into arrays, and also hints the config builder generator so that it can generate more accurate types for configurator methods.
Commits
-------
a0d0f95 [Config] Add `ArrayNodeDefinition::acceptAndWrap()` to list alternative types that should be accepted and wrapped in an arrayArrayNodeDefinition::acceptAndWrap() to list alternative types that should be accepted and wrapped in an array (nicolas-grekas)File tree
17 files changed
+286
-305
lines changed- src/Symfony
- Bundle
- FrameworkBundle
- DependencyInjection
- Tests/DependencyInjection
- SecurityBundle/DependencyInjection
- Security
- AccessToken
- Factory
- UserProvider
- TwigBundle/DependencyInjection
- Component/Config
- Builder
- Definition
- Builder
- Tests/Builder/Fixtures
17 files changed
+286
-305
lines changedLines changed: 173 additions & 176 deletions
Large diffs are not rendered by default.
Lines changed: 0 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2291 | 2291 | | |
2292 | 2292 | | |
2293 | 2293 | | |
2294 | | - | |
2295 | | - | |
2296 | | - | |
2297 | | - | |
2298 | 2294 | | |
2299 | 2295 | | |
2300 | 2296 | | |
| |||
Lines changed: 0 additions & 30 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
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 | 75 | | |
106 | 76 | | |
107 | 77 | | |
| |||
Lines changed: 20 additions & 26 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
61 | | - | |
| 60 | + | |
| 61 | + | |
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
83 | | - | |
| 83 | + | |
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
| |||
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
| 132 | + | |
137 | 133 | | |
138 | 134 | | |
139 | 135 | | |
| |||
159 | 155 | | |
160 | 156 | | |
161 | 157 | | |
162 | | - | |
| 158 | + | |
163 | 159 | | |
164 | 160 | | |
165 | 161 | | |
| |||
168 | 164 | | |
169 | 165 | | |
170 | 166 | | |
171 | | - | |
| 167 | + | |
172 | 168 | | |
173 | 169 | | |
174 | 170 | | |
175 | 171 | | |
176 | 172 | | |
177 | 173 | | |
178 | | - | |
| 174 | + | |
179 | 175 | | |
180 | 176 | | |
181 | 177 | | |
| |||
205 | 201 | | |
206 | 202 | | |
207 | 203 | | |
208 | | - | |
| 204 | + | |
209 | 205 | | |
210 | 206 | | |
211 | 207 | | |
212 | 208 | | |
213 | | - | |
| 209 | + | |
214 | 210 | | |
215 | 211 | | |
216 | 212 | | |
| |||
233 | 229 | | |
234 | 230 | | |
235 | 231 | | |
236 | | - | |
237 | | - | |
| 232 | + | |
| 233 | + | |
238 | 234 | | |
239 | | - | |
240 | | - | |
| 235 | + | |
| 236 | + | |
241 | 237 | | |
242 | 238 | | |
243 | 239 | | |
| |||
254 | 250 | | |
255 | 251 | | |
256 | 252 | | |
257 | | - | |
| 253 | + | |
258 | 254 | | |
259 | 255 | | |
260 | 256 | | |
| |||
265 | 261 | | |
266 | 262 | | |
267 | 263 | | |
| 264 | + | |
268 | 265 | | |
269 | | - | |
270 | | - | |
| 266 | + | |
| 267 | + | |
271 | 268 | | |
272 | 269 | | |
273 | 270 | | |
| |||
379 | 376 | | |
380 | 377 | | |
381 | 378 | | |
382 | | - | |
383 | | - | |
384 | | - | |
385 | | - | |
| 379 | + | |
386 | 380 | | |
387 | 381 | | |
388 | 382 | | |
| |||
427 | 421 | | |
428 | 422 | | |
429 | 423 | | |
430 | | - | |
| 424 | + | |
431 | 425 | | |
432 | 426 | | |
433 | 427 | | |
| |||
437 | 431 | | |
438 | 432 | | |
439 | 433 | | |
| 434 | + | |
440 | 435 | | |
441 | | - | |
442 | 436 | | |
443 | 437 | | |
444 | 438 | | |
| |||
Lines changed: 11 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
102 | | - | |
| 102 | + | |
103 | 103 | | |
104 | | - | |
| 104 | + | |
105 | 105 | | |
106 | 106 | | |
107 | | - | |
108 | | - | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
109 | 111 | | |
110 | 112 | | |
111 | 113 | | |
112 | 114 | | |
113 | 115 | | |
114 | | - | |
| 116 | + | |
115 | 117 | | |
116 | | - | |
| 118 | + | |
117 | 119 | | |
118 | 120 | | |
119 | | - | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
120 | 124 | | |
121 | 125 | | |
122 | 126 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | | - | |
| 68 | + | |
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| |||
Lines changed: 10 additions & 21 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
| 50 | + | |
54 | 51 | | |
55 | | - | |
56 | | - | |
57 | | - | |
| 52 | + | |
58 | 53 | | |
59 | 54 | | |
60 | 55 | | |
61 | 56 | | |
62 | 57 | | |
63 | 58 | | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
| 59 | + | |
| 60 | + | |
72 | 61 | | |
73 | | - | |
74 | | - | |
75 | | - | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
76 | 65 | | |
77 | 66 | | |
78 | 67 | | |
79 | 68 | | |
80 | | - | |
81 | | - | |
82 | | - | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
83 | 72 | | |
84 | 73 | | |
85 | 74 | | |
| |||
Lines changed: 3 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
136 | | - | |
137 | | - | |
138 | | - | |
| 136 | + | |
139 | 137 | | |
140 | 138 | | |
141 | 139 | | |
| |||
147 | 145 | | |
148 | 146 | | |
149 | 147 | | |
150 | | - | |
151 | | - | |
152 | | - | |
| 148 | + | |
153 | 149 | | |
154 | | - | |
| 150 | + | |
155 | 151 | | |
156 | 152 | | |
157 | 153 | | |
| |||
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
45 | 49 | | |
46 | 50 | | |
47 | 51 | | |
| |||
53 | 57 | | |
54 | 58 | | |
55 | 59 | | |
56 | | - | |
| 60 | + | |
57 | 61 | | |
58 | 62 | | |
59 | 63 | | |
| |||
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
48 | 52 | | |
49 | 53 | | |
50 | 54 | | |
| |||
57 | 61 | | |
58 | 62 | | |
59 | 63 | | |
60 | | - | |
| 64 | + | |
61 | 65 | | |
62 | 66 | | |
63 | 67 | | |
| |||
0 commit comments