5 * Contains \Drupal\Console\Core\Command\Exclude\ElephpantCommand.
8 namespace Drupal\Console\Core\Command\Exclude;
10 use Symfony\Component\Console\Input\InputInterface;
11 use Symfony\Component\Console\Output\OutputInterface;
12 use Symfony\Component\Console\Command\Command;
13 use Symfony\Component\Finder\Finder;
14 use Drupal\Console\Core\Command\Shared\CommandTrait;
15 use Drupal\Console\Core\Utils\TwigRenderer;
16 use Drupal\Console\Core\Style\DrupalStyle;
19 * Class ElephpantCommand
20 * @package Drupal\Console\Core\Command\Exclude
22 class ElephpantCommand extends Command
37 * DrupliconCommand constructor.
38 * @param string $appRoot
39 * @param TwigRenderer $renderer
41 public function __construct(
43 TwigRenderer $renderer
45 $this->appRoot = $appRoot;
46 $this->renderer = $renderer;
47 parent::__construct();
53 protected function configure()
56 ->setName('elephpant')
57 ->setDescription($this->trans('application.commands.elephpant.description'));
63 protected function execute(InputInterface $input, OutputInterface $output)
65 $io = new DrupalStyle($input, $output);
68 '%stemplates/core/elephpant/',
69 $this->appRoot . DRUPAL_CONSOLE_CORE
72 $finder = new Finder();
79 foreach ($finder as $template) {
80 $templates[] = $template->getRelativePathname();
83 $elephpant = $this->renderer->render(
86 $templates[array_rand($templates)]
90 $io->writeln($elephpant);