* Jordi Boggiano * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Composer\DependencyResolver\Operation; use Composer\Package\PackageInterface; /** * Abstract solver operation class. * * @author Konstantin Kudryashov */ abstract class SolverOperation implements OperationInterface { protected $reason; /** * Initializes operation. * * @param string $reason operation reason */ public function __construct($reason = null) { $this->reason = $reason; } /** * Returns operation reason. * * @return string */ public function getReason() { return $this->reason; } /** * @param $lock bool Whether this is an operation on the lock file * @return string */ abstract public function show($lock); protected function formatVersion(PackageInterface $package) { return $package->getFullPrettyVersion(); } }