File tree 1 file changed +3
-11
lines changed
1 file changed +3
-11
lines changed Original file line number Diff line number Diff line change @@ -2193,12 +2193,8 @@ the :class:`Symfony\\Component\\Routing\\Generator\\UrlGeneratorInterface` class
2193
2193
2194
2194
class SomeService
2195
2195
{
2196
- private $router;
2197
-
2198
- public function __construct(UrlGeneratorInterface $router)
2199
- {
2200
- $this->router = $router;
2201
- }
2196
+ public function __construct(private UrlGeneratorInterface $router)
2197
+ {}
2202
2198
2203
2199
public function someMethod()
2204
2200
{
@@ -2312,13 +2308,9 @@ Now you'll get the expected results when generating URLs in your commands::
2312
2308
2313
2309
class SomeCommand extends Command
2314
2310
{
2315
- private $router;
2316
-
2317
- public function __construct(RouterInterface $router)
2311
+ public function __construct(private RouterInterface $router)
2318
2312
{
2319
2313
parent::__construct();
2320
-
2321
- $this->router = $router;
2322
2314
}
2323
2315
2324
2316
protected function execute(InputInterface $input, OutputInterface $output): int
You can’t perform that action at this time.
0 commit comments