Skip to content

Commit 79188b4

Browse files
authored
Added coroutine option to AsCommand and ClosureCommand (#7392)
1 parent e71af68 commit 79188b4

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/AsCommand.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,11 @@ public function __construct(
2929
string $signature,
3030
private string $class,
3131
private string $method,
32+
bool $coroutine = true,
3233
) {
3334
$this->signature = $signature;
3435
$this->parameterParser = $container->get(ParameterParser::class);
36+
$this->coroutine = $coroutine;
3537

3638
parent::__construct();
3739

src/ClosureCommand.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,13 @@ public function describe(string $description): self
7575
return $this;
7676
}
7777

78+
public function coroutine(bool $coroutine): self
79+
{
80+
$this->coroutine = $coroutine;
81+
82+
return $this;
83+
}
84+
7885
/**
7986
* @param null|callable(Crontab $crontab):Crontab $callback
8087
*/

0 commit comments

Comments
 (0)