Skip to content

Commit 5555a54

Browse files
committed
Merge branch '6.1' into 6.2
* 6.1: Usage of "Constructor Promotion" for PHP >= 8.0.2
2 parents 8c443c6 + 55078f3 commit 5555a54

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

routing.rst

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2254,11 +2254,8 @@ the :class:`Symfony\\Component\\Routing\\Generator\\UrlGeneratorInterface` class
22542254

22552255
class SomeService
22562256
{
2257-
private $router;
2258-
2259-
public function __construct(UrlGeneratorInterface $router)
2257+
public function __construct(private UrlGeneratorInterface $router)
22602258
{
2261-
$this->router = $router;
22622259
}
22632260

22642261
public function someMethod()
@@ -2373,13 +2370,9 @@ Now you'll get the expected results when generating URLs in your commands::
23732370

23742371
class SomeCommand extends Command
23752372
{
2376-
private $router;
2377-
2378-
public function __construct(RouterInterface $router)
2373+
public function __construct(private RouterInterface $router)
23792374
{
23802375
parent::__construct();
2381-
2382-
$this->router = $router;
23832376
}
23842377

23852378
protected function execute(InputInterface $input, OutputInterface $output): int

0 commit comments

Comments
 (0)