8000 minor #51286 Improve 6.4 UPGRADE guide (wouterj) · symfony/symfony@cd53a82 · GitHub
[go: up one dir, main page]

Skip to content

Commit cd53a82

Browse files
minor #51286 Improve 6.4 UPGRADE guide (wouterj)
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
2 parents 6d7ca72 + ae63c18 commit cd53a82

File tree

2 files changed

+51
-13
lines changed

2 files changed

+51
-13
lines changed

UPGRADE-6.4.md

Lines changed: 49 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,50 @@ BrowserKit
99
Cache
1010
-----
1111

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

1414
DependencyInjection
1515
-------------------
1616

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

19+
*Before*
20+
```php
21+
class MailingListService implements ContainerAwareInterface
22+
{
23+
use ContainerAwareTrait;
24+
25+
public function sendMails()
26+
{
27+
$mailer = $this->container->get('mailer');
28+
29+
// ...
30+
}
31+
}
32+
```
33+
34+
*After*
35+
```php
36+
use Symfony\Component\Mailer\MailerInterface;
37+
38+
class MailingListService
39+
{
40+
public function __construct(
41+
private MailerInterface $mailer,
42+
) {
43+
}
44+
45+
public function sendMails()
46+
{
47+
$mailer = $this->mailer;
48+
49+
// ...
50+
}
51+
}
52+
```
53+
54+
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).
55+
1956
DoctrineBridge
2057
--------------
2158

@@ -27,7 +64,7 @@ DoctrineBridge
2764
ErrorHandler
2865
------------
2966

30-
* `FlattenExceptionNormalizer` no longer implements `ContextAwareNormalizerInterface`
67+
* [BC break] `FlattenExceptionNormalizer` no longer implements `ContextAwareNormalizerInterface`
3168

3269
Form
3370
----
@@ -40,20 +77,20 @@ Form
4077
FrameworkBundle
4178
---------------
4279

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

4784
HttpFoundation
4885
--------------
4986

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

5289
HttpKernel
5390
----------
5491

55-
* `BundleInterface` no longer extends `ContainerAwareInterface`
56-
* Add native return types to `TraceableEventDispatcher` and to `MergeExtensionConfigurationPass`
92+
* [BC break] `BundleInterface` no longer extends `ContainerAwareInterface`
93+
* [BC break] Add native return types to `TraceableEventDispatcher` and to `MergeExtensionConfigurationPass`
5794

5895
Messenger
5996
---------
@@ -63,7 +100,7 @@ Messenger
63100
MonologBridge
64101
-------------
65102

66-
* Add native return type to `Logger::clear()` and to `DebugProcessor::clear()`
103+
* [BC break] Add native return type to `Logger::clear()` and to `DebugProcessor::clear()`
67104

68105
PsrHttpMessageBridge
69106
--------------------
@@ -73,15 +110,15 @@ PsrHttpMessageBridge
73110
Routing
74111
-------
75112

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

80117
Security
81118
--------
82119

83-
* `UserValueResolver` no longer implements `ArgumentValueResolverInterface`
84-
* Make `PersistentToken` immutable
120+
* [BC break] `UserValueResolver` no longer implements `ArgumentValueResolverInterface`
121+
* [BC break] Make `PersistentToken` immutable
85122
* Deprecate accepting only `DateTime` for `TokenProviderInterface::updateToken()`, use `DateTimeInterface` instead
86123

87124
Serializer
@@ -93,7 +130,7 @@ Serializer
93130
Templating
94131
----------
95132

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

98135
Validator
99136
---------

UPGRADE-7.0.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ Symfony 6.4 and Symfony 7.0 will be released simultaneously at the end of Novemb
55
release process, both versions will have the same features, but Symfony 7.0 won't include any deprecated features.
66
To upgrade, make sure to resolve all deprecation notices.
77

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

0 commit comments

Comments
 (0)
0