<?php
declare(strict_types=1);

namespace PpPhp\Core\Platform\Console\Commands;

use PpPhp\Core\Platform\Console\AbstractCommand;

final class StreamTopicRegisterCommand extends AbstractCommand
{
    public function name(): string { return 'stream:topic:register'; }
    public function description(): string { return 'PPphp Stream Topic Register'; }

    public function handle(array $arguments = []): int
    {
        $this->title('PPphp Stream Topic Register');
        $topic = \PpPhp\Core\Platform\Event\Streaming\MessageBus::instance(\PpPhp\Core\Platform\Console\ConsolePath::basePath())->registerTopic('console.stream', 1); $this->line('Registered: ' . $topic->name());
        return 0;
    }
}
