From 76c04248e8bf032419a0470e9f8e1ca55a77ae45 Mon Sep 17 00:00:00 2001 From: Alexis Lefebvre Date: Thu, 5 Jan 2023 03:20:02 +0100 Subject: [PATCH] remove mention to required in service_container --- service_container/injection_types.rst | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/service_container/injection_types.rst b/service_container/injection_types.rst index 243856f1472..419bad912d0 100644 --- a/service_container/injection_types.rst +++ b/service_container/injection_types.rst @@ -116,15 +116,16 @@ by cloning the original service, this approach allows you to make a service immu // ... use Symfony\Component\Mailer\MailerInterface; + use Symfony\Contracts\Service\Attribute\Required; class NewsletterManager { private $mailer; /** - * @required * @return static */ + #[Required] public function withMailer(MailerInterface $mailer): self { $new = clone $this; @@ -220,14 +221,14 @@ that accepts the dependency:: // src/Mail/NewsletterManager.php namespace App\Mail; + use Symfony\Contracts\Service\Attribute\Required; + // ... class NewsletterManager { private $mailer; - /** - * @required - */ + #[Required] public function setMailer(MailerInterface $mailer): void { $this->mailer = $mailer;