-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtestsectioncommand.php
More file actions
31 lines (23 loc) · 842 Bytes
/
Copy pathtestsectioncommand.php
File metadata and controls
31 lines (23 loc) · 842 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?php
require_once __DIR__.'/vendor/autoload.php';
use Symfony\Component\Console\Application;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Question\Question;
use Symfony\Component\Console\Style\SymfonyStyle;
$command = new class() extends Command {
protected static $defaultName = 'Test';
protected function execute(InputInterface $input, OutputInterface $output)
{
$section = $output->section();
$section->writeln("Test");
$io = new SymfonyStyle($input, $output);
$io->ask('Test the input behavior');
return self::SUCCESS;
}
};
$app = new Application();
$app->add($command);
$app->setDefaultCommand($command->getName(), true);
$app->run();