File tree Expand file tree Collapse file tree 4 files changed +45
-0
lines changed
src/Symfony/Component/DependencyInjection Expand file tree Collapse file tree 4 files changed +45
-0
lines changed Original file line number Diff line number Diff line change 1
1
UPGRADE FROM 6.3 to 6.4
2
2
=======================
3
3
4
+ DependencyInjection
5
+ -------------------
6
+
7
+ * Deprecate ` ContainerAwareInterface ` and ` ContainerAwareTrait ` , use dependency injection instead
8
+
9
+ Before:
10
+ ``` php
11
+ class MyService implements ContainerAwareInterface
12
+ {
13
+ use ContainerAwareTrait;
14
+
15
+ // ...
16
+ }
17
+ ```
18
+
19
+ After:
20
+ ``` php
21
+ class MyService
22
+ {
23
+ private ContainerInterface $container;
24
+
25
+ // Inject the container through the constructor...
26
+ public function __construct(ContainerInterface $container)
27
+ {
28
+ $this->container = $container;
29
+ }
30
+
31
+ // ... or by using the #[Required] attribute
32
+ #[Required]
33
+ public function setContainer(ContainerInterface $container): void
34
+ {
35
+ $this->container = $container;
36
+ }
37
+ }
38
+ ```
39
+
4
40
DoctrineBridge
5
41
--------------
6
42
Original file line number Diff line number Diff line change 1
1
CHANGELOG
2
2
=========
3
3
4
+ 6.4
5
+ ---
6
+
7
+ * Deprecate ` ContainerAwareInterface ` and ` ContainerAwareTrait ` , use dependency injection instead
8
+
4
9
6.3
5
10
---
6
11
Original file line number Diff line number Diff line change 15
15
* ContainerAwareInterface should be implemented by classes that depends on a Container.
16
16
*
17
17
* @author Fabien Potencier <fabien@symfony.com>
18
+ *
19
+ * @deprecated since Symfony 6.4, use dependency injection instead
18
20
*/
19
21
interface ContainerAwareInterface
20
22
{
Original file line number Diff line number Diff line change 15
15
* ContainerAware trait.
16
16
*
17
17
* @author Fabien Potencier <fabien@symfony.com>
18
+ *
19
+ * @deprecated since Symfony 6.4, use dependency injection instead
18
20
*/
19
21
trait ContainerAwareTrait
20
22
{
You can’t perform that action at this time.
0 commit comments