8000 remove mention to required in service_container · symfony/symfony-docs@76c0424 · GitHub
[go: up one dir, main page]

Skip to content

Commit 76c0424

Browse files
remove mention to required in service_container
1 parent 7b93c1f commit 76c0424

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

service_container/injection_types.rst

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,15 +116,16 @@ by cloning the original service, this approach allows you to make a service immu
116116

117117
// ...
118118
use Symfony\Component\Mailer\MailerInterface;
119+
use Symfony\Contracts\Service\Attribute\Required;
119120

120121
class NewsletterManager
121122
{
122123
private $mailer;
123124

124125
/**
125-
* @required
126126
* @return static
127127
*/
128+
#[Required]
128129
public function withMailer(MailerInterface $mailer): self
129130
{
130131
$new = clone $this;
@@ -220,14 +221,14 @@ that accepts the dependency::
220221
// src/Mail/NewsletterManager.php
221222
namespace App\Mail;
222223

224+
use Symfony\Contracts\Service\Attribute\Required;
225+
223226
// ...
224227
class NewsletterManager
225228
{
226229
private $mailer;
227230

228-
/**
229-
* @required
230-
*/
231+
#[Required]
231232
public function setMailer(MailerInterface $mailer): void
232233
{
233234
$this->mailer = $mailer;

0 commit comments

Comments
 (0)
0