8000 minor #31866 [Routing] revert deprecation of Serializable in routing … · symfony/symfony@3242392 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3242392

Browse files
committed
minor #31866 [Routing] revert deprecation of Serializable in routing (Tobion)
This PR was merged into the 4.3 branch. Discussion ---------- [Routing] revert deprecation of Serializable in routing | Q | A | ------------- | --- | Branch? | 4.3 | Bug fix? | no | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | BC breaks? | no <!-- see https://symfony.com/bc --> | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tests pass? | yes <!-- please add some, will be required by reviewers --> | Fixed tickets | | License | MIT | Doc PR | we still need to implement Serializable as long as we support PHP < 7.4. otherwise serialized data in php 7.2 would not work anymore when people upgrade to php 7.4. see discussion in #31792 (comment) partly reverts #30286 Commits ------- d32a295 [Routing] revert deprecation of Serializable in routing
2 parents d90dd8d + d32a295 commit 3242392

File tree

5 files changed

+17
-10
lines changed

5 files changed

+17
-10
lines changed

UPGRADE-4.3.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,9 @@ Routing
121121

122122
* The `generator_base_class`, `generator_cache_class`, `matcher_base_class`, and `matcher_cache_class` router
123123
options have been deprecated.
124-
* Implementing `Serializable` for `Route` and `CompiledRoute` is deprecated; if you serialize them, please
125-
ensure your unserialization logic can recover from a failure related to an updated serialization format
124+
* `Serializable` implementing methods for `Route` and `CompiledRoute` are marked as `@internal` and `@final`.
125+
Instead of overwriting them, use `__serialize` and `__unserialize` as extension points which are forward compatible
126+
with the new serialization methods in PHP 7.4.
126127

127128
Security
128129
--------

UPGRADE-5.0.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,8 +282,9 @@ Routing
282282

283283
* The `generator_base_class`, `generator_cache_class`, `matcher_base_class`, and `matcher_cache_class` router
284284
options have been removed.
285-
* `Route` and `CompiledRoute` don't implement `Serializable` anymore; if you serialize them, please
286-
ensure your unserialization logic can recover from a failure related to an updated serialization format
285+
* `Serializable` implementing methods for `Route` and `CompiledRoute` are final.
286+
Instead of overwriting them, use `__serialize` and `__unserialize` as extension points which are forward compatible
287+
with the new serialization methods in PHP 7.4.
287288

288289
Security
289290
--------

src/Symfony/Component/Routing/CHANGELOG.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ CHANGELOG
88
* added `CompiledUrlGenerator` and `CompiledUrlGeneratorDumper`
99
* deprecated `PhpGeneratorDumper` and `PhpMatcherDumper`
1010
* deprecated `generator_base_class`, `generator_cache_class`, `matcher_base_class` and `matcher_cache_class` router options
11-
* deprecated implementing `Serializable` for `Route` and `CompiledRoute`; if you serialize them, please
12-
ensure your unserialization logic can recover from a failure related to an updated serialization format
11+
* `Serializable` implementing methods for `Route` and `CompiledRoute` are marked as `@internal` and `@final`.
12+
Instead of overwriting them, use `__serialize` and `__unserialize` as extension points which are forward compatible
13+
with the new serialization methods in PHP 7.4.
1314
* exposed `utf8` Route option, defaults "locale" and "format" in configuration loaders and configurators
1415
* added support for invokable route loader services
1516

src/Symfony/Component/Routing/CompiledRoute.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ public function __serialize(): array
6464
}
6565

6666
/**
67-
* @internal since Symfony 4.3, will be removed in Symfony 5 as the class won't implement Serializable anymore
67+
* @internal since Symfony 4.3
68+
* @final since Symfony 4.3
6869
*/
6970
public function serialize()
7071
{
@@ -84,7 +85,8 @@ public function __unserialize(array $data): void
8485
}
8586

8687
/**
87-
* @internal since Symfony 4.3, will be removed in Symfony 5 as the class won't implement Serializable anymore
88+
* @internal since Symfony 4.3
89+
* @final since Symfony 4.3
8890
*/
8991
public function unserialize($serialized)
9092
{

src/Symfony/Component/Routing/Route.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ public function __serialize(): array
7878
}
7979

8080
/**
81-
* @internal since Symfony 4.3, will be removed in Symfony 5 as the class won't implement Serializable anymore
81+
* @internal since Symfony 4.3
82+
* @final since Symfony 4.3
8283
*/
8384
public function serialize()
8485
{
@@ -104,7 +105,8 @@ public function __unserialize(array $data): void
104105
}
105106

106107
/**
107-
* @internal since Symfony 4.3, will be removed in Symfony 5 as the class won't implement Serializable anymore
108+
* @internal since Symfony 4.3
109+
* @final since Symfony 4.3
108110
*/
109111
public function unserialize($serialized)
110112
{

0 commit comments

Comments
 (0)
0