Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 08c8dbe

Browse filesBrowse files
committed
[Routing] revert deprecation of Serializable in routing
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
1 parent d90dd8d commit 08c8dbe
Copy full SHA for 08c8dbe

File tree

5 files changed

+17
-10
lines changed
Filter options

5 files changed

+17
-10
lines changed

‎UPGRADE-4.3.md

Copy file name to clipboardExpand all lines: UPGRADE-4.3.md
+3-2Lines 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` is 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

Copy file name to clipboardExpand all lines: UPGRADE-5.0.md
+3-2Lines 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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Routing/CHANGELOG.md
+3-2Lines 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` is 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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Routing/CompiledRoute.php
+4-2Lines 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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Routing/Route.php
+4-2Lines 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)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.