Stable Release in branch 5.2
5.2.14
Released 29 Jul 2021
(5 years ago)
SoftwareSymfony
Version5.2
Status
End of life
Supported
PHP versions
PHP ≥ 7.2.5
Initial release5.2.0
30 Nov 2020
(5 years ago)
Latest release5.2.14
29 Jul 2021
(5 years ago)
End of bug fixesJul 2021
(Ended 5 years ago)
End of security fixesJul 2021
(Ended 5 years ago)
Release noteshttps://github.com/symfony/symfony/releases/tag/v5.2.14
Source codehttps://github.com/symfony/symfony/tree/v5.2.14
Documentationhttps://symfony.com/doc/current/index.html
Downloadhttps://symfony.com/download
Symfony 5.2 ReleasesView full list

What Is New in Symfony 5.2

Symfony 5.2 introduces a set of new features, improvements, and deprecations to streamline development. The following table summarizes the key changes in this release.

Category Description
New Features Added support for UUID in Doctrine types, a new Uid field type for forms, and a PasswordUpgraderInterface.
Improvements Enhanced Messenger component with Redis transport improvements and better handling of failed messages.
Deprecations Several symfony/contracts packages are deprecated in favor of their standalone counterparts.
Bug Fixes Multiple fixes across the HttpClient, Form, and Security components for stability.

What new form field types were added?

The standout addition is the UidType form field. This field automatically handles UUID (or ULID) values, converting them from strings to UID objects and back. It integrates seamlessly with the new Doctrine DBAL types.

In practice, this means you can have a property mapped as a uuid in your entity and use UidType::class in your form without any manual data transformation. The form component takes care of the validation and conversion process for you.

How did the Messenger component improve?

Redis transport received significant attention. The connection logic is now more robust, handling persistent connections and serialization errors better. This matters because failed message handling in production is more predictable.

Another key improvement is the addition of a StopWorkerOnRestartSignalListener. This allows for graceful worker restarts during deployments on platforms that support POSIX signals, reducing the chance of message loss or duplication when updating code.

What changed with Symfony Contracts?

Several packages within symfony/contracts are now deprecated. The framework encourages using the standalone, component-specific packages instead, like symfony/http-client-contracts or symfony/service-contracts.

This shift allows for more granular dependency management. You only need to require the specific contract package your code depends on, rather than the larger, monolithic contracts bundle. Update your composer.json accordingly.

Were there any security-related updates?

Yes, the introduction of PasswordUpgraderInterface is a security enhancement. It provides a standard way to upgrade user passwords to a newer, more secure hashing algorithm after a successful login.

This is a proactive measure. When you decide to switch from bcrypt to Argon2, for example, the interface helps migrate passwords seamlessly in the background as users log in, without requiring a mass reset.

What improvements were made to HttpClient?

Stability and debugging got better. There were fixes for handling chunked responses more reliably and improvements to the TraceableHttpClient which gives you more insight into requests and responses during development.

For developers using async streams, the error handling in the response stream is now more consistent. This prevents some edge cases where a network issue could leave a promise hanging indefinitely.

FAQ

Should I upgrade my project to Symfony 5.2 immediately?
If your project is already on Symfony 5.x, the upgrade is straightforward. Review the deprecation notices in your dev log after updating. The new features like the Uid form field are opt-in, so you can upgrade without immediate code changes.

How do I start using the new Uid form field?
First, ensure you're using Doctrine DBAL 2.10+ and have the symfony/uid component. In your form, use UidType::class. The field will automatically work with entity properties typed as uuid or ulid.

What's the practical impact of the Contracts package deprecation?
For now, it's just a deprecation warning. Your code will still work. However, plan to replace symfony/contracts in your composer.json with the specific contract packages you need (e.g., symfony/http-client-contracts) in a future update to avoid breakage.

Does the new PasswordUpgraderInterface force me to change my password hashing?
No, it doesn't force anything. It provides a standardized hook (upgradePassword) that you can implement in your user provider. You call it manually after a successful login to re-hash the password if needed.

Are the Messenger Redis improvements backward compatible?
Generally, yes. The improvements focus on reliability and added features like the restart listener. Existing configuration and code should continue to work. Test your worker deployment process, as the new signal listener may affect how you restart workers.

Releases In Branch 5.2

VersionRelease date
5.2.1429 Jul 2021
(5 years ago)
5.2.1327 Jul 2021
(5 years ago)
5.2.1226 Jul 2021
(5 years ago)
5.2.1130 Jun 2021
(5 years ago)
5.2.1001 Jun 2021
(5 years ago)
5.2.919 May 2021
(5 years ago)
5.2.812 May 2021
(5 years ago)
5.2.701 May 2021
(5 years ago)
5.2.629 Mar 2021
(5 years ago)
5.2.510 Mar 2021
(5 years ago)
5.2.404 Mar 2021
(5 years ago)
5.2.303 Feb 2021
(5 years ago)
5.2.227 Jan 2021
(5 years ago)
5.2.118 Dec 2020
(5 years ago)
5.2.030 Nov 2020
(5 years ago)
5.2.0-RC221 Nov 2020
(5 years ago)
5.2.0-RC110 Nov 2020
(5 years ago)
5.2.0-BETA328 Oct 2020
(5 years ago)
5.2.0-BETA214 Oct 2020
(5 years ago)
5.2.0-BETA105 Oct 2020
(5 years ago)