use Symfony\Component\Console\Output\ConsoleOutput; $output = new ConsoleOutput(); $output->writeln('Hello World!');
use Symfony\Component\Console\Helper\Table; use Symfony\Component\Console\Output\ConsoleOutput; $data = [ ['John', 'Doe', 'john.doe@example.com'], ['Jane', 'Doe', 'jane.doe@example.com'], ]; $table = new Table(new ConsoleOutput()); $table->setHeaders(['First Name', 'Last Name', 'Email']); $table->setRows($data); $table->render();
use Symfony\Component\Console\Helper\ProgressBar; use Symfony\Component\Console\Output\ConsoleOutput; $output = new ConsoleOutput(); $progressBar = new ProgressBar($output, 10); $progressBar->start(); for ($i = 1; $i <= 10; $i++) { sleep(1); $progressBar->advance(); } $progressBar->finish();In summary, the `OutputInterface` class allows developers to output various types of information to the console, including text messages, tables, and progress bars, among others. It is part of the `Symfony\Component\Console\Output` package in Symfony.