Please sign in to comment.
feature #30286 Drop more usages of Serializable (nicolas-grekas)
This PR was merged into the 4.3-dev branch. Discussion ---------- Drop more usages of Serializable | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | yes | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - When the serialized payload of some class is used for ephemeral needs, my proposal here is to drop implementing `Serializable` and provide a deprecation layer based on `__sleep` to still call the `serialize`/`unserialize` methods. This means that at the behavior level, we provide BC, and at the payload level, we don't. That leaves us with only two "not ephemeral" use cases: - `Route` and `CompilerRoute` instances are serialized by Drupal. We'd better not break such existing payloads without being sure it's ok for Drupal (ping @alexpott). My proposal in this PR is to schedule the BC break for Symfony 5, and ask Drupal (and others) to add a check in their unserialization logic so that they are able to recompile the cached list of routes if unserialize fails due to this change. They could alternatively implement `Serializable` on their own, without calling `parent::(un)serialize()`. - `TokenInterface` from `Security` - for this one, I have no idea yet, except either plan for breaking BC at the payload level (which would mean invalidating all sessions when moving to SF5) - or create a new interface if we think breaking sessions is not reasonable. For now, I've kept using `Serializable`, which could be also fine keeping if we mark the corresponding method `final` to force WDYT? Commits ------- 05d6475 Drop more usages of Serializable
- Loading branch information...
Showing with 216 additions and 114 deletions.
- +2 −0 UPGRADE-4.3.md
- +2 −0 UPGRADE-5.0.md
- +4 −5 src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/AppKernel.php
- +1 −1 src/Symfony/Bundle/FrameworkBundle/composer.json
- +2 −7 src/Symfony/Component/Cache/Tests/Adapter/AdapterTestCase.php
- +2 −7 src/Symfony/Component/Cache/Tests/Psr16CacheTest.php
- +2 −7 src/Symfony/Component/Cache/Tests/Simple/CacheTestCase.php
- +2 −2 src/Symfony/Component/Debug/Tests/phpt/fatal_with_nested_handlers.phpt
- +1 −0 src/Symfony/Component/Form/CHANGELOG.md
- +9 −2 src/Symfony/Component/Form/Extension/DataCollector/FormDataCollector.php
- +2 −2 src/Symfony/Component/Form/composer.json
- +5 −0 src/Symfony/Component/HttpKernel/CHANGELOG.md
- +29 −1 src/Symfony/Component/HttpKernel/DataCollector/DataCollector.php
- +31 −8 src/Symfony/Component/HttpKernel/DataCollector/DumpDataCollector.php
- +33 −0 src/Symfony/Component/HttpKernel/Kernel.php
- +1 −1 src/Symfony/Component/HttpKernel/KernelInterface.php
- +5 −5 src/Symfony/Component/HttpKernel/Tests/DataCollector/DumpDataCollectorTest.php
- +2 −3 src/Symfony/Component/HttpKernel/Tests/KernelTest.php
- +2 −0 src/Symfony/Component/Routing/CHANGELOG.md
- +2 −2 src/Symfony/Component/Routing/CompiledRoute.php
- +2 −2 src/Symfony/Component/Routing/Route.php
- +21 −20 src/Symfony/Component/Security/CHANGELOG.md
- +8 −14 src/Symfony/Component/Security/Core/Authentication/Token/AbstractToken.php
- +33 −15 src/Symfony/Component/Security/Core/Exception/AuthenticationException.php
- +5 −5 src/Symfony/Component/Security/Core/Tests/Authentication/Token/AbstractTokenTest.php
- +5 −5 src/Symfony/Component/Security/Core/Tests/Exception/CustomUserMessageAuthenticationExceptionTest.php
- +3 −0 src/Symfony/Component/Security/Core/composer.json
Oops, something went wrong.