for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Equip\Command;
abstract class Command
{
/**
* @var OptionsInterface
*/
private $options;
* Execute the command using the current options.
*
* @return mixed
abstract public function execute();
* Allow usage as a callable.
* @see Command::execute()
final public function __invoke()
return $this->execute();
}
* Get the currently defined options.
* @return OptionsInterface
* @throws CommandException
* If no options have been added to the command.
final public function options()
if (!$this->options) {
throw CommandException::needsOptions($this);
return $this->options;
* Get a copy with new options.
* @param OptionsInterface $options
* @return static
final public function withOptions(OptionsInterface $options)
$copy = clone $this;
$copy->options = $options;
return $copy;