Skip to content

Commit 4fa15ae

Browse files
committed
Merge branch '3.4' into 4.4
* 3.4: [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 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 [Console] Inline exact-match handling with 4.4 Set previous exception when rethrown from controller resolver [VarDumper] fixed DateCaster not displaying additional fields [HttpKernel] fix registering DebugHandlersListener regardless of the PHP_SAPI
2 parents db75aa0 + 6827023 commit 4fa15ae

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
@@ -672,15 +672,7 @@ public function find($name)
672672
// filter out aliases for commands which are already on the list
673673
if (\count($commands) > 1) {
674674
$commandList = $this->commandLoader ? array_merge(array_flip($this->commandLoader->getNames()), $this->commands) : $this->commands;
675-
676-
if (isset($commandList[$name])) {
677-
return $this->get($name);
678-
}
679-
680-
foreach ($commands as $k => $nameOrAlias) {
681-
if ($nameOrAlias === $name) {
682-
return $this->get($nameOrAlias);
683-
}
675+
$commands = array_unique(array_filter($commands, function ($nameOrAlias) use (&$commandList, $commands, &$aliases) {
684676
if (!$commandList[$nameOrAlias] instanceof Command) {
685677
$commandList[$nameOrAlias] = $this->commandLoader->get($nameOrAlias);
686678
}
@@ -689,14 +681,8 @@ public function find($name)
689681

690682
$aliases[$nameOrAlias] = $commandName;
691683

692-
if ($commandName === $nameOrAlias || !\in_array($commandName, $commands)) {
693-
continue;
694-
}
695-
696-
unset($commands[$k]);
697-
}
698-
699-
$commands = array_unique($commands);
684+
return $commandName === $nameOrAlias || !\in_array($commandName, $commands);
685+
}));
700686
}
701687

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

0 commit comments

Comments
 (0)