Commit 58c4522
committed
bug symfony#52817 [Serializer] Do not instantiate object if it is not instantiable (maxbaldanza)
This PR was merged into the 5.4 branch.
Discussion
----------
[Serializer] Do not instantiate object if it is not instantiable
| Q | A
| ------------- | ---
| Branch? | 5.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Issues |
| License | MIT
If you pass an object that can't be instantiable such as enum to deserialize then you get the following
error `Error: Cannot instantiate enum` as the object is tried to be created without checking if it's instantiable
Commits
-------
298b15f Do not instantiate object if it is not instantiableFile tree
2 files changed
+23
-0
lines changed- src/Symfony/Component/Serializer
- Normalizer
- Tests/Normalizer
2 files changed
+23
-0
lines changedLines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
458 | 458 | | |
459 | 459 | | |
460 | 460 | | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
461 | 470 | | |
462 | 471 | | |
463 | 472 | | |
| |||
Lines changed: 14 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| 36 | + | |
35 | 37 | | |
36 | 38 | | |
37 | 39 | | |
| |||
279 | 281 | | |
280 | 282 | | |
281 | 283 | | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
282 | 296 | | |
0 commit comments