diff --git a/src/Illuminate/Process/InvokedProcess.php b/src/Illuminate/Process/InvokedProcess.php index 6f2a67095b0b..888b7957e17d 100644 --- a/src/Illuminate/Process/InvokedProcess.php +++ b/src/Illuminate/Process/InvokedProcess.php @@ -50,6 +50,19 @@ public function signal(int $signal) return $this; } + /** + * Stop the process if it is still running. + * + * @param float $timeout + * @param int|null $signal + * + * @return int|null + */ + public function stop(float $timeout = 10, ?int $signal = null) + { + return $this->process->stop($timeout, $signal); + } + /** * Determine if the process is still running. * diff --git a/src/Illuminate/Process/InvokedProcessPool.php b/src/Illuminate/Process/InvokedProcessPool.php index 29f8a6579bb5..318963168716 100644 --- a/src/Illuminate/Process/InvokedProcessPool.php +++ b/src/Illuminate/Process/InvokedProcessPool.php @@ -35,6 +35,19 @@ public function signal(int $signal) return $this->running()->each->signal($signal); } + /** + * Stop all processes that are still running + * + * @param float $timeout + * @param int|null $signal + * + * @return \Illuminate\Support\Collection + */ + public function stop(float $timeout = 10, ?int $signal = null) + { + return $this->running()->each->stop($timeout, $signal); + } + /** * Get the processes in the pool that are still currently running. *