Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d2eda50

Browse files
committed
Improvements
1 parent 55b2ea0 commit d2eda50

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

UPGRADE-7.3.md

+17
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,23 @@ Console
1313

1414
* Omitting parameter types in callables configured via `Command::setCode` method is deprecated
1515

16+
*Before*
17+
```php
18+
$command->setCode(function ($input, $output) {
19+
// ...
20+
});
21+
```
22+
23+
*After*
24+
```php
25+
use Symfony\Component\Console\Input\InputInterface;
26+
use Symfony\Component\Console\Output\OutputInterface;
27+
28+
$command->setCode(function (InputInterface $input, OutputInterface $output) {
29+
// ...
30+
});
31+
```
32+
1633
FrameworkBundle
1734
---------------
1835

src/Symfony/Component/Console/Command/Command.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ public function setCode(callable $code): static
328328
$code = $code(...);
329329
}
330330

331-
$this->code = new InvokableCommand($this, $code, true);
331+
$this->code = new InvokableCommand($this, $code, triggerDeprecations: true);
332332

333333
return $this;
334334
}

0 commit comments

Comments
 (0)