1
0
Fork 0

Add color to lock operations and dry run output

pull/8752/head
Jordi Boggiano 2020-04-08 15:18:28 +02:00
parent 2e64e8dc2e
commit 8930f1b824
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
6 changed files with 10 additions and 10 deletions

View File

@ -61,7 +61,7 @@ class InstallOperation extends SolverOperation
*/
public function show($lock)
{
return ($lock ? 'Locking ' : 'Installing ').$this->package->getPrettyName().' ('.$this->package->getFullPrettyVersion().')';
return ($lock ? 'Locking ' : 'Installing ').'<info>'.$this->package->getPrettyName().'</info> (<comment>'.$this->package->getFullPrettyVersion().'</comment>)';
}
/**

View File

@ -62,7 +62,7 @@ class MarkAliasInstalledOperation extends SolverOperation
*/
public function show($lock)
{
return 'Marking '.$this->package->getPrettyName().' ('.$this->package->getFullPrettyVersion().') as installed, alias of '.$this->package->getAliasOf()->getPrettyName().' ('.$this->package->getAliasOf()->getFullPrettyVersion().')';
return 'Marking <info>'.$this->package->getPrettyName().'</info> (<comment>'.$this->package->getFullPrettyVersion().'</comment>) as installed, alias of <info>'.$this->package->getAliasOf()->getPrettyName().'</info> (<comment>'.$this->package->getAliasOf()->getFullPrettyVersion().'</comment>)';
}
/**

View File

@ -62,7 +62,7 @@ class MarkAliasUninstalledOperation extends SolverOperation
*/
public function show($lock)
{
return 'Marking '.$this->package->getPrettyName().' ('.$this->package->getFullPrettyVersion().') as uninstalled, alias of '.$this->package->getAliasOf()->getPrettyName().' ('.$this->package->getAliasOf()->getFullPrettyVersion().')';
return 'Marking <info>'.$this->package->getPrettyName().'</info> (<comment>'.$this->package->getFullPrettyVersion().'</comment>) as uninstalled, alias of <info>'.$this->package->getAliasOf()->getPrettyName().'</info> (<comment>'.$this->package->getAliasOf()->getFullPrettyVersion().'</comment>)';
}
/**

View File

@ -61,7 +61,7 @@ class UninstallOperation extends SolverOperation
*/
public function show($lock)
{
return 'Removing '.$this->package->getPrettyName().' ('.$this->package->getFullPrettyVersion().')';
return 'Removing <info>'.$this->package->getPrettyName().'</info> (<comment>'.$this->package->getFullPrettyVersion().'</comment>)';
}
/**

View File

@ -88,7 +88,7 @@ class UpdateOperation extends SolverOperation
$actionName = VersionParser::isUpgrade($this->initialPackage->getVersion(), $this->targetPackage->getVersion()) ? 'Upgrading' : 'Downgrading';
return $actionName.' '.$this->initialPackage->getPrettyName().' ('.$fromVersion.' => '.$toVersion.')';
return $actionName.' <info>'.$this->initialPackage->getPrettyName().'</info> (<comment>'.$fromVersion.'</comment> => <comment>'.$toVersion.'</comment>)';
}
/**

View File

@ -57,14 +57,14 @@ class InstallationManagerMock extends InstallationManager
public function install(RepositoryInterface $repo, InstallOperation $operation)
{
$this->installed[] = $operation->getPackage();
$this->trace[] = (string) $operation;
$this->trace[] = strip_tags((string) $operation);
$repo->addPackage(clone $operation->getPackage());
}
public function update(RepositoryInterface $repo, UpdateOperation $operation)
{
$this->updated[] = array($operation->getInitialPackage(), $operation->getTargetPackage());
$this->trace[] = (string) $operation;
$this->trace[] = strip_tags((string) $operation);
$repo->removePackage($operation->getInitialPackage());
$repo->addPackage(clone $operation->getTargetPackage());
}
@ -72,7 +72,7 @@ class InstallationManagerMock extends InstallationManager
public function uninstall(RepositoryInterface $repo, UninstallOperation $operation)
{
$this->uninstalled[] = $operation->getPackage();
$this->trace[] = (string) $operation;
$this->trace[] = strip_tags((string) $operation);
$repo->removePackage($operation->getPackage());
}
@ -81,7 +81,7 @@ class InstallationManagerMock extends InstallationManager
$package = $operation->getPackage();
$this->installed[] = $package;
$this->trace[] = (string) $operation;
$this->trace[] = strip_tags((string) $operation);
parent::markAliasInstalled($repo, $operation);
}
@ -89,7 +89,7 @@ class InstallationManagerMock extends InstallationManager
public function markAliasUninstalled(RepositoryInterface $repo, MarkAliasUninstalledOperation $operation)
{
$this->uninstalled[] = $operation->getPackage();
$this->trace[] = (string) $operation;
$this->trace[] = strip_tags((string) $operation);
parent::markAliasUninstalled($repo, $operation);
}