Skip to content

Instantly share code, notes, and snippets.

@jmolivas
Last active May 30, 2016 06:18
Show Gist options
  • Save jmolivas/2f7539d138ca82e64870413a9d56b0bd to your computer and use it in GitHub Desktop.
Save jmolivas/2f7539d138ca82e64870413a9d56b0bd to your computer and use it in GitHub Desktop.
<?php
/**
* @file
* Contains \Drupal\Console\Develop\Example.
*/
namespace Drupal\Console\Command\Develop;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Command\Command;
use Drupal\Console\Command\Shared\CommandTrait;
use Drupal\Console\Style\DrupalStyle;
class ExampleCommand extends Command
{
use CommandTrait;
/**
* {@inheritdoc}
*/
protected function configure()
{
$this->setName('example');
}
/**
* {@inheritdoc}
*/
protected function interact(InputInterface $input, OutputInterface $output)
{
}
/**
* {@inheritdoc}
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
$io = new DrupalStyle($input, $output);
}
}
<?php
/**
* @file
* Contains \Drupal\Console\Develop\Example.
*/
namespace Drupal\Console\Command\Develop;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Command\Command;
use Drupal\Console\Command\Shared\ContainerAwareCommandTrait;
use Drupal\Console\Style\DrupalStyle;
class ExampleContainerAwareCommand extends Command
{
use ContainerAwareCommandTrait;
/**
* {@inheritdoc}
*/
protected function configure()
{
$this->setName('example');
}
/**
* {@inheritdoc}
*/
protected function interact(InputInterface $input, OutputInterface $output)
{
}
/**
* {@inheritdoc}
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
$io = new DrupalStyle($input, $output);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment