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

Skip to content

Commit ba3f404

Browse files
Applied ro0NL comments and fixed
1 parent 61b6e01 commit ba3f404

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ CHANGELOG
1616
* Added php ini session options `sid_length` and `sid_bits_per_character`
1717
to the `session` section of the configuration
1818
* Added support for Translator paths, Twig paths in translation commands.
19-
* Added `SuggestMissingPackageSubscriber` for suggesting missing packages when using console commands
2019

2120
4.2.0
2221
-----

src/Symfony/Bundle/FrameworkBundle/EventListener/SuggestMissingPackageSubscriber.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,19 +46,17 @@ final class SuggestMissingPackageSubscriber implements EventSubscriberInterface
4646

4747
public function onConsoleError(ConsoleErrorEvent $event): void
4848
{
49-
if (!$event->getError() instanceof CommandNotFoundException || $input = $event->getInput()->getFirstArgument()) {
49+
if (!$event->getError() instanceof CommandNotFoundException) {
5050
return;
5151
}
5252

53-
$input = explode(':', $input);
54-
$namespace = $input[0];
55-
$command = $input[1] ?? '';
53+
[$namespace, $command] = explode(':', $event->getInput()->getFirstArgument()) + [1 => ''];
5654

5755
if (!isset(self::PACKAGES[$namespace])) {
5856
return;
5957
}
6058

61-
if (isset(self::PACKAGES[$namespace][$command]) && '' !== $command) {
59+
if (isset(self::PACKAGES[$namespace][$command])) {
6260
$suggestion = self::PACKAGES[$namespace][$command];
6361
$exact = true;
6462
} else {

0 commit comments

Comments
 (0)