<?php declare(strict_types=1);
namespace Inhere\Console\Examples\Command;
use Inhere\Console\Command;
use Inhere\Console\IO\Input;
use Inhere\Console\IO\Output;
use Inhere\Console\Util\Helper;
class CorCommand extends Command
{
protected static $name = 'cor';
protected static $description = 'a coroutine test command';
protected static $coroutine = true;
public static function aliases(): array
{
return ['coro'];
}
protected function execute($input, $output)
{
$output->aList([
'support coroutine?' => Helper::isSupportCoroutine() ? 'Y' : 'N',
'open coroutine running?' => self::isCoroutine() ? 'Y' : 'N',
'running in coroutine?' => Helper::inCoroutine() ? 'Y' : 'N',
], 'some information');
}
}