Skip to content

Commit

Permalink
minor #51286 Improve 6.4 UPGRADE guide (wouterj)
Browse files Browse the repository at this point in the history
This PR was merged into the 6.4 branch.

Discussion
----------

Improve 6.4 UPGRADE guide

| Q             | A
| ------------- | ---
| Branch?       | 6.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        |

Commits
-------

ae63c18 Improve 6.4 UPGRADE guide
  • Loading branch information
nicolas-grekas committed Aug 5, 2023
2 parents 6d7ca72 + ae63c18 commit cd53a82
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 13 deletions.
61 changes: 49 additions & 12 deletions UPGRADE-6.4.md
Expand Up @@ -9,13 +9,50 @@ BrowserKit
Cache
-----

* `EarlyExpirationHandler` no longer implements `MessageHandlerInterface`, rely on `AsMessageHandler` instead
* [BC break] `EarlyExpirationHandler` no longer implements `MessageHandlerInterface`, rely on `AsMessageHandler` instead

DependencyInjection
-------------------

* Deprecate `ContainerAwareInterface` and `ContainerAwareTrait`, use dependency injection instead

*Before*
```php
class MailingListService implements ContainerAwareInterface
{
use ContainerAwareTrait;

public function sendMails()
{
$mailer = $this->container->get('mailer');

// ...
}
}
```

*After*
```php
use Symfony\Component\Mailer\MailerInterface;

class MailingListService
{
public function __construct(
private MailerInterface $mailer,
) {
}

public function sendMails()
{
$mailer = $this->mailer;

// ...
}
}
```

To fetch services lazily, you can use a [service subscriber](https://symfony.com/doc/6.4/service_container/service_subscribers_locators.html#defining-a-service-subscriber).

DoctrineBridge
--------------

Expand All @@ -27,7 +64,7 @@ DoctrineBridge
ErrorHandler
------------

* `FlattenExceptionNormalizer` no longer implements `ContextAwareNormalizerInterface`
* [BC break] `FlattenExceptionNormalizer` no longer implements `ContextAwareNormalizerInterface`

Form
----
Expand All @@ -40,20 +77,20 @@ Form
FrameworkBundle
---------------

* Add native return type to `Translator` and to `Application::reset()`
* [BC break] Add native return type to `Translator` and to `Application::reset()`
* Deprecate the integration of Doctrine annotations, either uninstall the `doctrine/annotations` package or disable
the integration by setting `framework.annotations` to `false`

HttpFoundation
--------------

* Make `HeaderBag::getDate()`, `Response::getDate()`, `getExpires()` and `getLastModified()` return a `DateTimeImmutable`
* [BC break] Make `HeaderBag::getDate()`, `Response::getDate()`, `getExpires()` and `getLastModified()` return a `DateTimeImmutable`

HttpKernel
----------

* `BundleInterface` no longer extends `ContainerAwareInterface`
* Add native return types to `TraceableEventDispatcher` and to `MergeExtensionConfigurationPass`
* [BC break] `BundleInterface` no longer extends `ContainerAwareInterface`
* [BC break] Add native return types to `TraceableEventDispatcher` and to `MergeExtensionConfigurationPass`

Messenger
---------
Expand All @@ -63,7 +100,7 @@ Messenger
MonologBridge
-------------

* Add native return type to `Logger::clear()` and to `DebugProcessor::clear()`
* [BC break] Add native return type to `Logger::clear()` and to `DebugProcessor::clear()`

PsrHttpMessageBridge
--------------------
Expand All @@ -73,15 +110,15 @@ PsrHttpMessageBridge
Routing
-------

* Add native return type to `AnnotationClassLoader::setResolver()`
* [BC break] Add native return type to `AnnotationClassLoader::setResolver()`
* Deprecate Doctrine annotations support in favor of native attributes
* Change the constructor signature of `AnnotationClassLoader` to `__construct(?string $env = null)`, passing an annotation reader as first argument is deprecated
* Deprecate passing an annotation reader as first argument to `AnnotationClassLoader` (new signature: `__construct(?string $env = null)`)

Security
--------

* `UserValueResolver` no longer implements `ArgumentValueResolverInterface`
* Make `PersistentToken` immutable
* [BC break] `UserValueResolver` no longer implements `ArgumentValueResolverInterface`
* [BC break] Make `PersistentToken` immutable
* Deprecate accepting only `DateTime` for `TokenProviderInterface::updateToken()`, use `DateTimeInterface` instead

Serializer
Expand All @@ -93,7 +130,7 @@ Serializer
Templating
----------

* The component is deprecated and will be removed in 7.0. Use Twig instead.
* The component is deprecated and will be removed in 7.0, use [Twig](https://twig.symfony.com) instead

Validator
---------
Expand Down
3 changes: 2 additions & 1 deletion UPGRADE-7.0.md
Expand Up @@ -5,4 +5,5 @@ Symfony 6.4 and Symfony 7.0 will be released simultaneously at the end of Novemb
release process, both versions will have the same features, but Symfony 7.0 won't include any deprecated features.
To upgrade, make sure to resolve all deprecation notices.

This file will be updated on the branch 7.0 for each deprecated feature that is removed.
This file will be updated on the [7.0 branch](https://github.com/symfony/symfony/blob/7.0/UPGRADE-7.0.md) for each
deprecated feature that is removed.

0 comments on commit cd53a82

Please sign in to comment.