Skip to content

Commit 5064ae3

Browse files
committed
Merge branch '8.0' into 8.1
* 8.0: Minor tweak Update autowiring.rst
2 parents a9e8db1 + b97db48 commit 5064ae3

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

service_container/autowiring.rst

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -677,26 +677,25 @@ The ``#[Autowire]`` attribute can also be used for :ref:`parameters <service-par
677677
public function __construct(
678678
// use the %...% syntax for parameters
679679
#[Autowire('%kernel.project_dir%/data')]
680-
string $dataDir,
680+
private string $dataDir,
681681

682682
// or use argument "param"
683683
#[Autowire(param: 'kernel.debug')]
684-
bool $debugMode,
684+
private bool $debugMode,
685685

686686
// expressions
687687
#[Autowire(expression: 'service("App\\\Mail\\\MailerConfiguration").getMailerMethod()')]
688-
string $mailerMethod,
688+
private string $mailerMethod,
689689

690690
// environment variables
691691
#[Autowire(env: 'SOME_ENV_VAR')]
692-
string $senderName,
692+
private string $senderName,
693693

694694
// environment variables with processors
695695
#[Autowire(env: 'bool:SOME_BOOL_ENV_VAR')]
696-
bool $allowAttachments,
696+
private bool $allowAttachments,
697697
) {
698698
}
699-
// ...
700699
}
701700

702701
.. _autowiring_closures:

0 commit comments

Comments
 (0)