This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
Go to file
Fabien Potencier 7951ea16e5 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
-------

05d6475c5e Drop more usages of Serializable
2019-03-04 09:48:36 +01:00
.composer Drop hirak/prestissimo 2016-05-12 07:44:15 -05:00
.github Merge branch '3.4' into 4.2 2019-02-12 21:06:11 +01:00
src/Symfony Drop more usages of Serializable 2019-03-04 09:45:35 +01:00
.appveyor.yml Merge branch '4.1' 2018-09-05 14:00:05 +02:00
.editorconfig Update .editorconfig 2018-09-06 16:22:56 +02:00
.gitignore Add appveyor.yml for C.I. on Windows 2015-08-25 23:41:37 +02:00
.php_cs.dist fixed CS 2019-01-16 21:35:37 +01:00
.travis.yml Merge branch '3.4' into 4.2 2019-02-08 14:06:27 +01:00
CHANGELOG-4.0.md Merge branch '3.4' into 4.1 2018-08-01 18:22:14 +02:00
CHANGELOG-4.1.md updated CHANGELOG for 4.1.10 2019-01-06 17:16:07 +01:00
CHANGELOG-4.2.md updated CHANGELOG for 4.2.3 2019-02-03 13:47:28 +01:00
CODE_OF_CONDUCT.md Added the Code of Conduct file 2018-10-10 03:13:30 -07:00
composer.json [Mime] added classes for generating MIME messages 2019-03-02 15:10:47 +01:00
CONTRIBUTING.md Mention the community review guide 2016-12-18 22:02:35 +01:00
CONTRIBUTORS.md update CONTRIBUTORS for 3.4.22 2019-02-03 13:22:40 +01:00
LICENSE update year in license files 2019-01-01 14:45:19 +01:00
link appending root of Contracts dir (where composer.json is located) 2018-07-31 21:19:26 +03:00
phpunit Bump phpunit bridge cache id 2019-01-24 22:33:33 +01:00
phpunit.xml.dist Merge branch '4.1' 2018-11-11 20:52:12 +01:00
README.md Merge branch '2.8' into 3.4 2018-05-25 16:50:57 +02:00
UPGRADE-4.0.md Merge branch '3.4' into 4.2 2019-02-23 16:17:42 +01:00
UPGRADE-4.1.md Merge branch '4.0' into 4.1 2018-05-31 12:17:53 +02:00
UPGRADE-4.2.md [Contracts] extract LocaleAwareInterface out of TranslatorInterface 2018-12-05 08:06:11 +00:00
UPGRADE-4.3.md Drop more usages of Serializable 2019-03-04 09:45:35 +01:00
UPGRADE-5.0.md Drop more usages of Serializable 2019-03-04 09:45:35 +01:00

Symfony is a PHP framework for web applications and a set of reusable PHP components. Symfony is used by thousands of web applications (including BlaBlaCar.com and Spotify.com) and most of the popular PHP projects (including Drupal and Magento).

Installation

Documentation

Community

Contributing

Symfony is an Open Source, community-driven project with thousands of contributors. Join them contributing code or contributing documentation.

Security Issues

If you discover a security vulnerability within Symfony, please follow our disclosure procedure.

About Us

Symfony development is sponsored by SensioLabs, led by the Symfony Core Team and supported by Symfony contributors.