@@ -135,7 +135,7 @@ class Process implements \IteratorAggregate
135135 * @param mixed|null $input The input as stream resource, scalar or \Traversable, or null for no input
136136 * @param int|float|null $timeout The timeout in seconds or null to disable
137137 *
138- * @throws RuntimeException When proc_open is not installed
138+ * @throws LogicException When proc_open is not installed
139139 */
140140 public function __construct ($ command , string $ cwd = null , array $ env = null , $ input = null , ?float $ timeout = 60 )
141141 {
@@ -188,7 +188,7 @@ public function __construct($command, string $cwd = null, array $env = null, $in
188188 *
189189 * @return static
190190 *
191- * @throws RuntimeException When proc_open is not installed
191+ * @throws LogicException When proc_open is not installed
192192 */
193193 public static function fromShellCommandline (string $ command , string $ cwd = null , array $ env = null , $ input = null , ?float $ timeout = 60 )
194194 {
@@ -223,9 +223,11 @@ public function __clone()
223223 *
224224 * @return int The exit status code
225225 *
226- * @throws RuntimeException When process can't be launched
227- * @throws RuntimeException When process stopped after receiving signal
228- * @throws LogicException In case a callback is provided and output has been disabled
226+ * @throws RuntimeException When process can't be launched
227+ * @throws RuntimeException When process is already running
228+ * @throws ProcessTimedOutException When process timed out
229+ * @throws ProcessSignaledException When process stopped after receiving signal
230+ * @throws LogicException In case a callback is provided and output has been disabled
229231 *
230232 * @final
231233 */
@@ -393,9 +395,9 @@ public function restart(callable $callback = null, array $env = []): self
393395 *
394396 * @return int The exitcode of the process
395397 *
396- * @throws RuntimeException When process timed out
397- * @throws RuntimeException When process stopped after receiving signal
398- * @throws LogicException When process is not yet started
398+ * @throws ProcessTimedOutException When process timed out
399+ * @throws ProcessSignaledException When process stopped after receiving signal
400+ * @throws LogicException When process is not yet started
399401 */
400402 public function wait (callable $ callback = null )
401403 {
@@ -406,7 +408,7 @@ public function wait(callable $callback = null)
406408 if (null !== $ callback ) {
407409 if (!$ this ->processPipes ->haveReadSupport ()) {
408410 $ this ->stop (0 );
409- throw new \ LogicException ('Pass the callback to the "Process::start" method or call enableOutput to use a callback with "Process::wait" ' );
411+ throw new LogicException ('Pass the callback to the "Process::start" method or call enableOutput to use a callback with "Process::wait" ' );
410412 }
411413 $ this ->callback = $ this ->buildCallback ($ callback );
412414 }
@@ -436,8 +438,9 @@ public function wait(callable $callback = null)
436438 * from the output in real-time while writing the standard input to the process.
437439 * It allows to have feedback from the independent process during execution.
438440 *
439- * @throws RuntimeException When process timed out
440- * @throws LogicException When process is not yet started
441+ * @throws RuntimeException When process timed out
442+ * @throws LogicException When process is not yet started
443+ * @throws ProcessTimedOutException In case the timeout was reached
441444 */
442445 public function waitUntil (callable $ callback ): bool
443446 {
@@ -446,7 +449,7 @@ public function waitUntil(callable $callback): bool
446449
447450 if (!$ this ->processPipes ->haveReadSupport ()) {
448451 $ this ->stop (0 );
449- throw new \ LogicException ('Pass the callback to the "Process::start" method or call enableOutput to use a callback with "Process::waitUntil". ' );
452+ throw new LogicException ('Pass the callback to the "Process::start" method or call enableOutput to use a callback with "Process::waitUntil". ' );
450453 }
451454 $ callback = $ this ->buildCallback ($ callback );
452455
0 commit comments