Commit 8969e6f
committed
feature #63541 [HttpFoundation] Deprecate setting public properties of
This PR was merged into the 8.1 branch.
Discussion
----------
[HttpFoundation] Deprecate setting public properties of `Request` and `Response` objects directly
| Q | A
| ------------- | ---
| Branch? | 8.1
| Bug fix? | no
| New feature? | yes
| Deprecations? | yes
| Issues | -
| License | MIT
PHP 8.4 property hooks allow adding a set hook to existing properties without breaking the public API. This PR leverages that to deprecate external direct assignments to Request and Response properties.
The goal is to make our beloved `Request` and `Response` objects safer by using `public private(set)` in 9.0.
That's only for public properties, which are the ones that hold value objects (`ParameterBag`/`HeaderBag`) which shouldn't be reassigned at will.
Commits
-------
8b2209e3972 [HttpFoundation] Deprecate setting public properties of `Request` and `Response` objects directlyRequest and Response objects directly (nicolas-grekas)2 files changed
+16
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
| 58 | + | |
65 | 59 | | |
66 | 60 | | |
67 | 61 | | |
68 | 62 | | |
69 | 63 | | |
70 | | - | |
71 | | - | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
72 | 77 | | |
73 | 78 | | |
74 | 79 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
28 | | - | |
| 27 | + | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| |||
0 commit comments