Skip to content
Snippets Groups Projects
Select Git revision
  • efdc5ece05f3827d8fa424d77ade2184d757a1f3
  • main default protected
  • v0.2.1
  • v0.2.0
  • v0.1.2
  • v0.1.0
  • v0.1.1
7 results

TestCommand.php

Blame
  • TestCommand.php 831 B
    <?php
    
    declare(strict_types=1);
    
    namespace Dbp\Relay\TemplateBundle\Command;
    
    use Symfony\Component\Console\Command\Command;
    use Symfony\Component\Console\Input\InputArgument;
    use Symfony\Component\Console\Input\InputInterface;
    use Symfony\Component\Console\Output\OutputInterface;
    
    class TestCommand extends Command
    {
        protected static $defaultName = 'dbp:my-custom-command';
    
        public function __construct()
        {
            parent::__construct();
        }
    
        protected function configure()
        {
            $this->addArgument('argument', InputArgument::REQUIRED, 'Example.');
            $this->setDescription('Hey there!');
        }
    
        protected function execute(InputInterface $input, OutputInterface $output)
        {
            $argument = $input->getArgument('argument');
            $output->writeln($argument);
    
            return 0;
        }
    }