@@ -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 */
@@ -390,9 +392,9 @@ public function restart(callable $callback = null, array $env = [])
390392 *
391393 * @return int The exitcode of the process
392394 *
393- * @throws RuntimeException When process timed out
394- * @throws RuntimeException When process stopped after receiving signal
395- * @throws LogicException When process is not yet started
395+ * @throws ProcessTimedOutException When process timed out
396+ * @throws ProcessSignaledException When process stopped after receiving signal
397+ * @throws LogicException When process is not yet started
396398 */
397399 public function wait (callable $ callback = null )
398400 {
@@ -403,7 +405,7 @@ public function wait(callable $callback = null)
403405 if (null !== $ callback ) {
404406 if (!$ this ->processPipes ->haveReadSupport ()) {
405407 $ this ->stop (0 );
406- throw new \ LogicException ('Pass the callback to the "Process::start" method or call enableOutput to use a callback with "Process::wait" ' );
408+ throw new LogicException ('Pass the callback to the "Process::start" method or call enableOutput to use a callback with "Process::wait" ' );
407409 }
408410 $ this ->callback = $ this ->buildCallback ($ callback );
409411 }
@@ -433,8 +435,9 @@ public function wait(callable $callback = null)
433435 * from the output in real-time while writing the standard input to the process.
434436 * It allows to have feedback from the independent process during execution.
435437 *
436- * @throws RuntimeException When process timed out
437- * @throws LogicException When process is not yet started
438+ * @throws RuntimeException When process timed out
439+ * @throws LogicException When process is not yet started
440+ * @throws ProcessTimedOutException In case the timeout was reached
438441 */
439442 public function waitUntil (callable $ callback ): bool
440443 {
@@ -443,7 +446,7 @@ public function waitUntil(callable $callback): bool
443446
444447 if (!$ this ->processPipes ->haveReadSupport ()) {
445448 $ this ->stop (0 );
446- throw new \ LogicException ('Pass the callback to the "Process::start" method or call enableOutput to use a callback with "Process::waitUntil". ' );
449+ throw new LogicException ('Pass the callback to the "Process::start" method or call enableOutput to use a callback with "Process::waitUntil". ' );
447450 }
448451 $ callback = $ this ->buildCallback ($ callback );
449452
0 commit comments