From ededd88f2ed4268167175c61989056216e32db59 Mon Sep 17 00:00:00 2001 From: Eser DENIZ Date: Thu, 21 Nov 2024 23:58:23 +0100 Subject: [PATCH] fix: child process cmd: option except iterable array TypeError: settings.cmd is not iterable at startPhpProcess --- src/ChildProcess.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/ChildProcess.php b/src/ChildProcess.php index 171210f..32cedbc 100644 --- a/src/ChildProcess.php +++ b/src/ChildProcess.php @@ -58,10 +58,11 @@ public function start( ?array $env = null, bool $persistent = false ): static { + $cmd = is_array($cmd) ? array_values($cmd) : [$cmd]; $process = $this->client->post('child-process/start', [ 'alias' => $alias, - 'cmd' => (array) $cmd, + 'cmd' => $cmd, 'cwd' => $cwd ?? base_path(), 'env' => $env, 'persistent' => $persistent, @@ -72,9 +73,11 @@ public function start( public function php(string|array $cmd, string $alias, ?array $env = null, ?bool $persistent = false): self { + $cmd = is_array($cmd) ? array_values($cmd) : [$cmd]; + $process = $this->client->post('child-process/start-php', [ 'alias' => $alias, - 'cmd' => (array) $cmd, + 'cmd' => $cmd, 'cwd' => $cwd ?? base_path(), 'env' => $env, 'persistent' => $persistent,