Skip to content

Instantly share code, notes, and snippets.

@eS-IT
Last active June 13, 2020 09:29
Show Gist options
  • Save eS-IT/f894bb3dcd0900f66aade75865f9d6e4 to your computer and use it in GitHub Desktop.
Save eS-IT/f894bb3dcd0900f66aade75865f9d6e4 to your computer and use it in GitHub Desktop.
TestOutputCommand
<?php
namespace Esit\Easyfewo\Classes\Commands;
use Contao\CoreBundle\Framework\ContaoFramework;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Style\SymfonyStyle;
class TestOutputCommand extends Command
{
protected static $defaultName = 'test:output';
protected $framework;
private $io;
public function __construct(ContaoFramework $contaoFramework)
{
$this->framework = $contaoFramework;
parent::__construct();
}
protected function configure(): void
{
$this->setDescription('Prints a Message to cmd');
}
protected function execute(InputInterface $input, OutputInterface $output): ?int
{
$this->framework->initialize();
$this->io = new SymfonyStyle($input, $output);
// HIER DIE OUTPUT-STATEMENTS EINFÜGEN!
return 0;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment