Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit d2eda50

Browse filesBrowse files
committed
Improvements
1 parent 55b2ea0 commit d2eda50
Copy full SHA for d2eda50

File tree

2 files changed

+18
-1
lines changed
Filter options

2 files changed

+18
-1
lines changed

‎UPGRADE-7.3.md

Copy file name to clipboardExpand all lines: UPGRADE-7.3.md
+17Lines changed: 17 additions & 0 deletions
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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Console/Command/Command.php
+1-1Lines changed: 1 addition & 1 deletion
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.