Skip to content

Commit 24646c4

Browse files
committed
[DI] add #[Required] where applicable
1 parent c7dbcc9 commit 24646c4

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/Symfony/Bundle/FrameworkBundle/Controller/AbstractController.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
use Symfony\Component\Serializer\SerializerInterface;
4343
use Symfony\Component\WebLink\EventListener\AddLinkHeaderListener;
4444
use Symfony\Component\WebLink\GenericLinkProvider;
45+
use Symfony\Contracts\Service\Attribute\Required;
4546
use Symfony\Contracts\Service\ServiceSubscriberInterface;
4647
use Twig\Environment;
4748

@@ -60,6 +61,7 @@ abstract class AbstractController implements ServiceSubscriberInterface
6061
/**
6162
* @required
6263
*/
64+
#[Required]
6365
public function setContainer(ContainerInterface $container): ?ContainerInterface
6466
{
6567
$previous = $this->container;

src/Symfony/Contracts/Service/ServiceSubscriberTrait.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespace Symfony\Contracts\Service;
1313

1414
use Psr\Container\ContainerInterface;
15+
use Symfony\Contracts\Service\Attribute\Required;
1516
use Symfony\Contracts\Service\Attribute\SubscribedService;
1617

1718
/**
@@ -67,9 +68,7 @@ public static function getSubscribedServices(): array
6768
return $services;
6869
}
6970

70-
/**
71-
* @required
72-
*/
71+
#[Required]
7372
public function setContainer(ContainerInterface $container): ?ContainerInterface
7473
{
7574
$this->container = $container;

0 commit comments

Comments
 (0)