Improve output of operations to show details about dev versions
parent
bd9aa6a288
commit
fafd09a7ba
|
@ -61,6 +61,6 @@ class InstallOperation extends SolverOperation
|
|||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return 'Installing '.$this->package->getPrettyName().' ('.$this->package->getPrettyVersion().')';
|
||||
return 'Installing '.$this->package->getPrettyName().' ('.$this->formatVersion($this->package).')';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -42,4 +42,13 @@ abstract class SolverOperation implements OperationInterface
|
|||
{
|
||||
return $this->reason;
|
||||
}
|
||||
|
||||
protected function formatVersion(PackageInterface $package)
|
||||
{
|
||||
if (!$package->isDev() || !in_array($package->getSourceType(), array('hg', 'git'))) {
|
||||
return $package->getPrettyVersion();
|
||||
}
|
||||
|
||||
return $package->getPrettyVersion().' '.substr($package->getSourceReference(), 0, 6);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -61,6 +61,6 @@ class UninstallOperation extends SolverOperation
|
|||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return 'Uninstalling '.$this->package->getPrettyName().' ('.$this->package->getPrettyVersion().')';
|
||||
return 'Uninstalling '.$this->package->getPrettyName().' ('.$this->formatVersion($this->package).')';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -74,7 +74,7 @@ class UpdateOperation extends SolverOperation
|
|||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return 'Updating '.$this->initialPackage->getPrettyName().' ('.$this->initialPackage->getPrettyVersion().') to '.
|
||||
$this->targetPackage->getPrettyName(). ' ('.$this->targetPackage->getPrettyVersion().')';
|
||||
return 'Updating '.$this->initialPackage->getPrettyName().' ('.$this->formatVersion($this->initialPackage).') to '.
|
||||
$this->targetPackage->getPrettyName(). ' ('.$this->formatVersion($this->targetPackage).')';
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue