Skip to content

Commit ededd88

Browse files
authored
fix: child process cmd: option except iterable array
TypeError: settings.cmd is not iterable at startPhpProcess
1 parent 3b3d8dc commit ededd88

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/ChildProcess.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,11 @@ public function start(
5858
?array $env = null,
5959
bool $persistent = false
6060
): static {
61+
$cmd = is_array($cmd) ? array_values($cmd) : [$cmd];
6162

6263
$process = $this->client->post('child-process/start', [
6364
'alias' => $alias,
64-
'cmd' => (array) $cmd,
65+
'cmd' => $cmd,
6566
'cwd' => $cwd ?? base_path(),
6667
'env' => $env,
6768
'persistent' => $persistent,
@@ -72,9 +73,11 @@ public function start(
7273

7374
public function php(string|array $cmd, string $alias, ?array $env = null, ?bool $persistent = false): self
7475
{
76+
$cmd = is_array($cmd) ? array_values($cmd) : [$cmd];
77+
7578
$process = $this->client->post('child-process/start-php', [
7679
'alias' => $alias,
77-
'cmd' => (array) $cmd,
80+
'cmd' => $cmd,
7881
'cwd' => $cwd ?? base_path(),
7982
'env' => $env,
8083
'persistent' => $persistent,

0 commit comments

Comments
 (0)