Skip to content
Snippets Groups Projects
BaseCommand.php 792 B
<?php

namespace LakeDrops\Component\Composer;

use Composer\Command\BaseCommand as ComposerBaseCommand;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

/**
 * Class BaseCommand.
 *
 * @package LakeDrops\Component\Composer
 */
abstract class BaseCommand extends ComposerBaseCommand implements BaseCommandInterface {

  /**
   * The handler object to do the real work then.
   *
   * @var \LakeDrops\Component\Composer\BaseHandlerInterface
   */
  protected $handler;

  /**
   * {@inheritdoc}
   */
  protected function execute(InputInterface $input, OutputInterface $output) {
    $class = $this->getHandlerClass();
    $this->handler = new $class($this->getComposer(), $this->getIO());
    $this->handler->setInput($input);
  }

}