Commit cabe552
committed
feature symfony#61023 [Serializer] add
This PR was squashed before being merged into the 7.4 branch.
Discussion
----------
[Serializer] add `can` to the accessor prefixes recognized by the `AttributeLoader`
| Q | A
| ------------- | ---
| Branch? | 7.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Issues | Fix symfony#61021
| License | MIT
The ObjectNormalizer already recognizes `canX` as an accessor and "generates" a property for that, the AttributeLoader does not, so #[Ignore] attributes on `canX` are ignored, the return value is encoded in the normalized data.
We just add the `can` prefix ot the list of accepted accessor prefixes, so the AttributeLoader now also recognized these.
I adapted a test that _seemd to me_ to fit the best. If you'd prefer a dedicated test for that, I can do that, too.
Commits
-------
fb1da0b [Serializer] add `can` to the accessor prefixes recognized by the `AttributeLoader`can to the accessor prefixes recognized by the AttributeLoader (Mark Schmale)File tree
4 files changed
+13
-1
lines changed- src/Symfony/Component/Serializer
- Mapping/Loader
- Tests
- Fixtures/Attributes
- Mapping/Loader
4 files changed
+13
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
4 | 9 | | |
5 | 10 | | |
6 | 11 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
117 | | - | |
| 117 | + | |
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
| |||
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
31 | 37 | | |
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
| 156 | + | |
156 | 157 | | |
157 | 158 | | |
158 | 159 | | |
| |||
0 commit comments