use Symfony\Component\Console\Application; $application = new Application();
use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; class MyCommand extends Command { protected function configure() { $this->setName('my-command') ->setDescription('My command description'); } protected function execute(InputInterface $input, OutputInterface $output) { $output->writeln('Executing my command'); } } $application->add(new MyCommand());
use Symfony\Component\Console\Application; $application = new Application(); $application->run();In general, Symfony\Component\Console is part of the Symfony framework and provides a robust set of tools for building command-line applications in PHP.