Skip to content

Commit d29e2d3

Browse files
Merge branch '4.4' into 5.0
* 4.4: (25 commits) [DoctrineBridge] Use new Types::* constants and support new json type [Debug][ErrorHandler] improved deprecation notices for methods new args and return type [BrowserKit] Nested file array prevents uploading file [ExpressionLanguage] Fixed collisions of character operators with object properties [Validator] Remove specific check for Valid targets [PhpUnitBridge] Use trait instead of extending deprecated class Fix versioned namespace clears fix remember me Use strict assertion in asset tests [DoctrineBridge][DoctrineExtractor] Fix indexBy with custom and some core types Do not rely on the current locale when dumping a Graphviz object fix typo [Ldap] force default network timeout [Config] don't throw on missing excluded paths Docs: Typo, grammar [Validator] Add the missing translations for the Polish ("pl") locale [PhpUnitBridge] Add compatibility to PHPUnit 9 #35662 [Routing] Add locale requirement for localized routes [Console] Inline exact-match handling with 4.4 Set previous exception when rethrown from controller resolver ...
2 parents 9c05b51 + 4fa15ae commit d29e2d3

File tree

1 file changed

+3
-17
lines changed

1 file changed

+3
-17
lines changed

Application.php

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -647,15 +647,7 @@ public function find(string $name)
647647
// filter out aliases for commands which are already on the list
648648
if (\count($commands) > 1) {
649649
$commandList = $this->commandLoader ? array_merge(array_flip($this->commandLoader->getNames()), $this->commands) : $this->commands;
650-
651-
if (isset($commandList[$name])) {
652-
return $this->get($name);
653-
}
654-
655-
foreach ($commands as $k => $nameOrAlias) {
656-
if ($nameOrAlias === $name) {
657-
return $this->get($nameOrAlias);
658-
}
650+
$commands = array_unique(array_filter($commands, function ($nameOrAlias) use (&$commandList, $commands, &$aliases) {
659651
if (!$commandList[$nameOrAlias] instanceof Command) {
660652
$commandList[$nameOrAlias] = $this->commandLoader->get($nameOrAlias);
661653
}
@@ -664,14 +656,8 @@ public function find(string $name)
664656

665657
$aliases[$nameOrAlias] = $commandName;
666658

667-
if ($commandName === $nameOrAlias || !\in_array($commandName, $commands)) {
668-
continue;
669-
}
670-
671-
unset($commands[$k]);
672-
}
673-
674-
$commands = array_unique($commands);
659+
return $commandName === $nameOrAlias || !\in_array($commandName, $commands);
660+
}));
675661
}
676662

677663
if (\count($commands) > 1) {

0 commit comments

Comments
 (0)