Skip to content

Commit 55078f3

Browse files
committed
Merge branch '6.0' into 6.1
* 6.0: Usage of "Constructor Promotion" for PHP >= 8.0.2
2 parents c405efa + 835a8e0 commit 55078f3

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
@@ -2250,11 +2250,8 @@ the :class:`Symfony\\Component\\Routing\\Generator\\UrlGeneratorInterface` class
22502250

22512251
class SomeService
22522252
{
2253-
private $router;
2254-
2255-
public function __construct(UrlGeneratorInterface $router)
2253+
public function __construct(private UrlGeneratorInterface $router)
22562254
{
2257-
$this->router = $router;
22582255
}
22592256

22602257
public function someMethod()
@@ -2369,13 +2366,9 @@ Now you'll get the expected results when generating URLs in your commands::
23692366

23702367
class SomeCommand extends Command
23712368
{
2372-
private $router;
2373-
2374-
public function __construct(RouterInterface $router)
2369+
public function __construct(private RouterInterface $router)
23752370
{
23762371
parent::__construct();
2377-
2378-
$this->router = $router;
23792372
}
23802373

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

0 commit comments

Comments
 (0)