Skip to content
Snippets Groups Projects
Select Git revision
  • 24a54d1917071bbb468645999abcf10b6acc00c9
  • main default protected
  • step-2
3 results

HelloWorldCommand.php

Blame
  • HelloWorldCommand.php 691 B
    <?php
    
    namespace TechDivision\QsWorkshop\Command;
    
    use Symfony\Component\Console\Command\Command;
    use Symfony\Component\Console\Input\InputInterface;
    use Symfony\Component\Console\Output\OutputInterface;
    
    class HelloWorldCommand extends Command
    {
        protected function configure()
        {
            $this
                ->setName('hello')
                ->setDescription('Prints Hello')
                ->setHelp('This command prints a simple greeting.');
        }
    
        protected function execute(InputInterface $input, OutputInterface $output): int
        {
            $output->writeln("Hello, " . get_current_user() . "!");
            $output->writeln("It's " . date("l"));
            return Command::SUCCESS;
        }
    }