Commit 92a6bd1
committed
bug symfony#61727 Replace __sleep/wakeup() by __(un)serialize() for throwing and internal usages (nicolas-grekas)
This PR was merged into the 6.4 branch.
Discussion
----------
Replace __sleep/wakeup() by __(un)serialize() for throwing and internal usages
| Q | A
| ------------- | ---
| Branch? | 6.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Issues | -
| License | MIT
This PR replaces `__sleep`/`wakeup()` by `__(un)serialize()`, for throwing and internal usages.
This follows the merge of php/php-src#19435
While this change on 8.5 might be reverted (see https://wiki.php.net/rfc/soft-deprecate-sleep-wakeup), we can still remove all those cases.
This DOES NOT replace all use cases of `__sleep`/`wakeup()`. We did so already on branch 7.4, but doing it on branch 6.4 is another story. This would basically be way to risky IMHO, with a bunch of non-trivial code to add just to fix the deprecation.
My recommendation for those remaining use cases is to ignore the deprecation. By the time ppl will move to PHP 8.5, they will also move away from Symfony 6.4
I'll submit another PR to the phpunit-bridge for that.
For the record, here is the list of files/classes that cannot be "just" migrated to `__(un)serialize()`
(I'll let the reader wonder about how they could be - and compare their ideas to what we did in 7.4):
- src/Symfony/Component/HttpKernel/Profiler/Profile.php
- src/Symfony/Component/HttpKernel/DataCollector/DataCollector.php
- src/Symfony/Component/HttpKernel/Kernel.php
- src/Symfony/Component/String/AbstractString.php
- src/Symfony/Component/String/LazyString.php
- src/Symfony/Component/Mime/Part/SMimePart.php
- src/Symfony/Component/Mime/Part/TextPart.php
- src/Symfony/Component/Mime/Part/DataPart.php
- src/Symfony/Component/Validator/Constraint.php
- src/Symfony/Component/Validator/Mapping/GenericMetadata.php
- src/Symfony/Component/Validator/Mapping/MemberMetadata.php
- src/Symfony/Component/Validator/Mapping/ClassMetadata.php
- src/Symfony/Component/Serializer/Mapping/AttributeMetadata.php
- src/Symfony/Component/Serializer/Mapping/ClassMetadata.php
Commits
-------
ef4e3d6 Replace __sleep/wakeup() by __(un)serialize() for throwing and internal usagesFile tree
54 files changed
+344
-480
lines changed- .github
- src/Symfony
- Bridge
- Monolog/Handler
- PhpUnit/Legacy
- Bundle/FrameworkBundle/Tests
- Functional/app
- Kernel
- flex-style/src
- Component
- Cache
- Adapter
- Tests
- Adapter
- Traits
- Config/Resource
- DependencyInjection/Loader/Configurator
- ErrorHandler
- ErrorRenderer
- Form
- Extension/DataCollector
- Util
- HttpClient
- Chunk
- Response
- HttpKernel
- DataCollector
- Tests/DataCollector
- Ldap/Adapter/ExtLdap
- Lock
- Mailer/Transport/Smtp
- Messenger/Bridge
- AmazonSqs/Transport
- Doctrine
- Tests/Transport
- Transport
- Mime/Part
- Process
- Pipes
- Routing/Loader/Configurator
- Semaphore
- Serializer/Tests/Normalizer
- VarDumper/Cloner
- Internal
- VarExporter/Tests
- Fixtures
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
54 files changed
+344
-480
lines changedLarge diffs are not rendered by default.
Lines changed: 2 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
152 | | - | |
| 152 | + | |
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
156 | 156 | | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
| 157 | + | |
161 | 158 | | |
162 | 159 | | |
163 | 160 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
96 | | - | |
| 96 | + | |
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
101 | | - | |
| 101 | + | |
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
| |||
Lines changed: 6 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
92 | | - | |
| 92 | + | |
93 | 93 | | |
94 | | - | |
| 94 | + | |
95 | 95 | | |
96 | 96 | | |
97 | | - | |
| 97 | + | |
98 | 98 | | |
99 | | - | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
100 | 102 | | |
101 | 103 | | |
102 | 104 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | | - | |
| 66 | + | |
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | | - | |
| 71 | + | |
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | | - | |
| 67 | + | |
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
| 72 | + | |
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
294 | 294 | | |
295 | 295 | | |
296 | 296 | | |
297 | | - | |
| 297 | + | |
298 | 298 | | |
299 | 299 | | |
300 | 300 | | |
301 | 301 | | |
302 | | - | |
303 | | - | |
304 | | - | |
305 | | - | |
| 302 | + | |
306 | 303 | | |
307 | 304 | | |
308 | 305 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
373 | 373 | | |
374 | 374 | | |
375 | 375 | | |
376 | | - | |
| 376 | + | |
377 | 377 | | |
378 | 378 | | |
379 | 379 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
176 | 176 | | |
177 | 177 | | |
178 | 178 | | |
179 | | - | |
| 179 | + | |
180 | 180 | | |
181 | 181 | | |
182 | 182 | | |
| |||
Lines changed: 2 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
276 | 276 | | |
277 | 277 | | |
278 | 278 | | |
279 | | - | |
| 279 | + | |
280 | 280 | | |
281 | 281 | | |
282 | 282 | | |
283 | 283 | | |
284 | | - | |
285 | | - | |
286 | | - | |
287 | | - | |
| 284 | + | |
288 | 285 | | |
289 | 286 | | |
290 | 287 | | |
| |||
0 commit comments