/**
* Write a notice to IO
*
* @param string $action
* @param \Netresearch\Composer\Patches\Patch $patch
* @param \Composer\Package\PackageInterface $package
*/
protected function writePatchNotice($action, Patch $patch, PackageInterface $package)
{
$adverbMap = array('test' => 'on', 'apply' => 'to', 'revert' => 'from');
if ($action == 'test' && !$this->io->isVeryVerbose()) {
return;
}
$msg = ' - ' . ucfirst($action) . 'ing patch';
if ($this->io->isVerbose() || !isset($patch->title)) {
$msg .= ' <info>' . $patch->getChecksum() . '</info>';
}
$msg .= ' ' . $adverbMap[$action];
$msg .= ' <info>' . $package->getName() . '</info>';
if ($this->io->isVerbose()) {
' (<comment>' . $package->getPrettyVersion() . '</comment>)';
}
if (isset($patch->title)) {
$msg .= ': <comment>' . $patch->title . '</comment>';
}
$this->io->write($msg);
}