8000 [Routing] revert deprecation of Serializable in routing by Tobion · Pull Request #31866 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Routing] revert deprecation of Serializable in routing #31866

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
[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
  • Loading branch information
Tobion committed Jun 5, 2019
commit d32a29527b582ad88b5c24f38c1680100ace4546
5 changes: 3 additions & 2 deletions UPGRADE-4.3.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,9 @@ Routing

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

Security
--------
Expand Down
5 changes: 3 additions & 2 deletions UPGRADE-5.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -282,8 +282,9 @@ Routing

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

Security
--------
Expand Down
5 changes: 3 additions & 2 deletions src/Symfony/Component/Routing/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ CHANGELOG
* added `CompiledUrlGenerator` and `CompiledUrlGeneratorDumper`
* deprecated `PhpGeneratorDumper` and `PhpMatcherDumper`
* deprecated `generator_base_class`, `generator_cache_class`, `matcher_base_class` and `matcher_cache_class` router options
* deprecated implementing `Serializable` for `Route` and `CompiledRoute`; if you serialize them, please
ensure your unserialization logic can recover from a failure related to an updated serialization format
* `Serializable` implementing methods for `Route` and `CompiledRoute` are marked as `@internal` and `@final`.
Instead of overwriting them, use `__serialize` and `__unserialize` as extension points which are forward compatible
with the new serialization methods in PHP 7.4.
* exposed `utf8` Route option, defaults "locale" and "format" in configuration loaders and configurators
* added support for invokable route loader services

Expand Down
6 changes: 4 additions & 2 deletions src/Symfony/Component/Routing/CompiledRoute.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ public function __serialize(): array
}

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

/**
* @internal since Symfony 4.3, will be removed in Symfony 5 as the class won't implement Serializable anymore
* @internal since Symfony 4.3
* @final since Symfony 4.3
*/
public function unserialize($serialized)
{
Expand Down
6 changes: 4 additions & 2 deletions src/Symfony/Component/Routing/Route.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ public function __serialize(): array
}

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

/**
* @internal since Symfony 4.3, will be removed in Symfony 5 as the class won't implement Serializable anymore
* @internal since Symfony 4.3
* @final since Symfony 4.3
*/
public function unserialize($serialized)
{
Expand Down
0