Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 3 additions & 11 deletions routing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2193,12 +2193,8 @@ the :class:`Symfony\\Component\\Routing\\Generator\\UrlGeneratorInterface` class

class SomeService
{
private $router;

public function __construct(UrlGeneratorInterface $router)
{
$this->router = $router;
}
public function __construct(private UrlGeneratorInterface $router)
{}
Comment on lines +2196 to +2197
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure which code style Symfony uses, but we should use the same

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


public function someMethod()
{
Expand Down Expand Up @@ -2312,13 +2308,9 @@ Now you'll get the expected results when generating URLs in your commands::

class SomeCommand extends Command
{
private $router;

public function __construct(RouterInterface $router)
public function __construct(private RouterInterface $router)
{
parent::__construct();

$this->router = $router;
}

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