Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
| Total | |
0.00% |
0 / 1 |
|
0.00% |
0 / 3 |
CRAP | |
0.00% |
0 / 10 |
| CreateEventStreamCommand | |
0.00% |
0 / 1 |
|
0.00% |
0 / 3 |
12 | |
0.00% |
0 / 10 |
| __construct | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 3 |
|||
| configure | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 4 |
|||
| execute | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 3 |
|||
| <?php | |
| declare(strict_types=1); | |
| namespace App\UI\Cli\Command; | |
| use ArrayIterator; | |
| use Prooph\EventStore\EventStore; | |
| use Prooph\EventStore\Stream; | |
| use Prooph\EventStore\StreamName; | |
| use Symfony\Component\Console\Command\Command; | |
| use Symfony\Component\Console\Input\InputInterface; | |
| use Symfony\Component\Console\Output\OutputInterface; | |
| final class CreateEventStreamCommand extends Command | |
| { | |
| private EventStore $eventStore; | |
| public function __construct(EventStore $eventStore) | |
| { | |
| $this->eventStore = $eventStore; | |
| parent::__construct(); | |
| } | |
| protected function configure(): void | |
| { | |
| $this->setName('event-store:event-stream:create') | |
| ->setDescription('Create event_stream.') | |
| ->setHelp('This command creates the event_stream'); | |
| } | |
| protected function execute(InputInterface $input, OutputInterface $output): int | |
| { | |
| $this->eventStore->create(new Stream(new StreamName('event_stream'), new ArrayIterator([]))); | |
| $output->writeln('<info>Event stream was created successfully.</info>'); | |
| return 0; | |
| } | |
| } |