Fix output inconsistencies when aliases are being used and '0 installs, 0 updates 0 removals' was being shown when any alias was present compared to 'Nothing to install, update or remove' when no alias is being used. (#11159)
parent
bc29ffa500
commit
0430722e66
|
@ -751,22 +751,20 @@ class Installer
|
||||||
$localRepoTransaction = new LocalRepoTransaction($lockedRepository, $localRepo);
|
$localRepoTransaction = new LocalRepoTransaction($lockedRepository, $localRepo);
|
||||||
$this->eventDispatcher->dispatchInstallerEvent(InstallerEvents::PRE_OPERATIONS_EXEC, $this->devMode, $this->executeOperations, $localRepoTransaction);
|
$this->eventDispatcher->dispatchInstallerEvent(InstallerEvents::PRE_OPERATIONS_EXEC, $this->devMode, $this->executeOperations, $localRepoTransaction);
|
||||||
|
|
||||||
if (!$localRepoTransaction->getOperations()) {
|
$installs = $updates = $uninstalls = [];
|
||||||
$this->io->writeError('Nothing to install, update or remove');
|
foreach ($localRepoTransaction->getOperations() as $operation) {
|
||||||
|
if ($operation instanceof InstallOperation) {
|
||||||
|
$installs[] = $operation->getPackage()->getPrettyName().':'.$operation->getPackage()->getFullPrettyVersion();
|
||||||
|
} elseif ($operation instanceof UpdateOperation) {
|
||||||
|
$updates[] = $operation->getTargetPackage()->getPrettyName().':'.$operation->getTargetPackage()->getFullPrettyVersion();
|
||||||
|
} elseif ($operation instanceof UninstallOperation) {
|
||||||
|
$uninstalls[] = $operation->getPackage()->getPrettyName();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($localRepoTransaction->getOperations()) {
|
if ($installs === [] && $updates === [] && $uninstalls === []) {
|
||||||
$installs = $updates = $uninstalls = [];
|
$this->io->writeError('Nothing to install, update or remove');
|
||||||
foreach ($localRepoTransaction->getOperations() as $operation) {
|
} else {
|
||||||
if ($operation instanceof InstallOperation) {
|
|
||||||
$installs[] = $operation->getPackage()->getPrettyName().':'.$operation->getPackage()->getFullPrettyVersion();
|
|
||||||
} elseif ($operation instanceof UpdateOperation) {
|
|
||||||
$updates[] = $operation->getTargetPackage()->getPrettyName().':'.$operation->getTargetPackage()->getFullPrettyVersion();
|
|
||||||
} elseif ($operation instanceof UninstallOperation) {
|
|
||||||
$uninstalls[] = $operation->getPackage()->getPrettyName();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->io->writeError(sprintf(
|
$this->io->writeError(sprintf(
|
||||||
"<info>Package operations: %d install%s, %d update%s, %d removal%s</info>",
|
"<info>Package operations: %d install%s, %d update%s, %d removal%s</info>",
|
||||||
count($installs),
|
count($installs),
|
||||||
|
|
Loading…
Reference in New Issue