Commit e642384
committed
bug #62396 [PropertyInfo] Fix inconsistency between isWritable and getWriteInfo (yoeunes)
This PR was merged into the 6.4 branch.
Discussion
----------
[PropertyInfo] Fix inconsistency between isWritable and getWriteInfo
| Q | A
| ------------- | ---
| Branch? | 6.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Issues | -
| License | MIT
This PR fixes an inconsistency between `isWritable` and `getWriteInfo` in the `ReflectionExtractor`.
`isWritable()` correctly found mutators for `snake_case` properties because it had a fallback mechanism:
1. Check for `setSnakeProperty`
2. If not found, check for `setSnake_method`
The `getWriteInfo()` method *only* checked for the camelCase version (`setSnakeProperty`)
This caused `isWritable(..., 'snake_method')` to return `true`, while `getWriteInfo(..., 'snake_method')` would incorrectly return `TYPE_NONE`.
Commits
-------
340d3f9 [PropertyInfo] Fix inconsistency between isWritable and getWriteInfoFile tree
2 files changed
+33
-0
lines changed- src/Symfony/Component/PropertyInfo
- Extractor
- Tests/Extractor
2 files changed
+33
-0
lines changedLines changed: 30 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
305 | 305 | | |
306 | 306 | | |
307 | 307 | | |
| 308 | + | |
308 | 309 | | |
309 | 310 | | |
310 | 311 | | |
| |||
347 | 348 | | |
348 | 349 | | |
349 | 350 | | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
350 | 369 | | |
| 370 | + | |
351 | 371 | | |
352 | 372 | | |
353 | 373 | | |
| |||
358 | 378 | | |
359 | 379 | | |
360 | 380 | | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
361 | 391 | | |
362 | 392 | | |
363 | 393 | | |
| |||
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
633 | 633 | | |
634 | 634 | | |
635 | 635 | | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
636 | 639 | | |
637 | 640 | | |
638 | 641 | | |
| |||
0 commit comments