<?php
declare(strict_types=1);

namespace PpPhp\Core\Platform\Console\Commands;

use PpPhp\Core\Platform\Console\AbstractCommand;

final class HumanTaskInboxCommand extends AbstractCommand
{
    public function name(): string { return 'workflow:human:inbox'; }
    public function description(): string { return 'PPphp Human Task Inbox'; }

    public function handle(array $arguments = []): int
    {
        $this->title('PPphp Human Task Inbox');
        $runtime = \PpPhp\Core\Platform\Workflow\HumanTask\HumanTaskRuntime::instance(\PpPhp\Core\Platform\Console\ConsolePath::basePath()); foreach ($runtime->inbox('alice', ['managers']) as $task) { $this->line('- ' . $task['taskId'] . ' title=' . $task['title'] . ' status=' . $task['status']); }
        return 0;
    }
}
