Skip to content

Commit

Permalink
Merge branch '4.4' into 5.0
Browse files Browse the repository at this point in the history
* 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
  ...
  • Loading branch information
nicolas-grekas committed Feb 24, 2020
2 parents 9c05b51 + 4fa15ae commit d29e2d3
Showing 1 changed file with 3 additions and 17 deletions.
20 changes: 3 additions & 17 deletions Application.php
Expand Up @@ -647,15 +647,7 @@ public function find(string $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 @@ -664,14 +656,8 @@ public function find(string $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 d29e2d3

Please sign in to comment.