Skip to content

Commit

Permalink
Merge branch '3.4' into 4.4
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
fabpot committed Feb 24, 2020
2 parents db75aa0 + 6827023 commit 4fa15ae
Showing 1 changed file with 3 additions and 17 deletions.
20 changes: 3 additions & 17 deletions Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -672,15 +672,7 @@ public function find($name)
// filter out aliases for commands which are already on the list
if (\count($commands) > 1) {
$commandList = $this->commandLoader ? array_merge(array_flip($this->commandLoader->getNames()), $this->commands) : $this->commands;

if (isset($commandList[$name])) {
return $this->get($name);
}

foreach ($commands as $k => $nameOrAlias) {
if ($nameOrAlias === $name) {
return $this->get($nameOrAlias);
}
$commands = array_unique(array_filter($commands, function ($nameOrAlias) use (&$commandList, $commands, &$aliases) {
if (!$commandList[$nameOrAlias] instanceof Command) {
$commandList[$nameOrAlias] = $this->commandLoader->get($nameOrAlias);
}
Expand All @@ -689,14 +681,8 @@ public function find($name)

$aliases[$nameOrAlias] = $commandName;

if ($commandName === $nameOrAlias || !\in_array($commandName, $commands)) {
continue;
}

unset($commands[$k]);
}

$commands = array_unique($commands);
return $commandName === $nameOrAlias || !\in_array($commandName, $commands);
}));
}

if (\count($commands) > 1) {
Expand Down

0 comments on commit 4fa15ae

Please sign in to comment.