@@ -135,7 +135,7 @@ class Process implements \IteratorAggregate
135
135
* @param mixed|null $input The input as stream resource, scalar or \Traversable, or null for no input
136
136
* @param int|float|null $timeout The timeout in seconds or null to disable
137
137
*
138
- * @throws RuntimeException When proc_open is not installed
138
+ * @throws LogicException When proc_open is not installed
139
139
*/
140
140
public function __construct ($ command , string $ cwd = null , array $ env = null , $ input = null , ?float $ timeout = 60 )
141
141
{
@@ -188,7 +188,7 @@ public function __construct($command, string $cwd = null, array $env = null, $in
188
188
*
189
189
* @return static
190
190
*
191
- * @throws RuntimeException When proc_open is not installed
191
+ * @throws LogicException When proc_open is not installed
192
192
*/
193
193
public static function fromShellCommandline (string $ command , string $ cwd = null , array $ env = null , $ input = null , ?float $ timeout = 60 )
194
194
{
@@ -223,9 +223,11 @@ public function __clone()
223
223
*
224
224
* @return int The exit status code
225
225
*
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
229
231
*
230
232
* @final
231
233
*/
@@ -390,9 +392,9 @@ public function restart(callable $callback = null, array $env = [])
390
392
*
391
393
* @return int The exitcode of the process
392
394
*
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
396
398
*/
397
399
public function wait (callable $ callback = null )
398
400
{
@@ -403,7 +405,7 @@ public function wait(callable $callback = null)
403
405
if (null !== $ callback ) {
404
406
if (!$ this ->processPipes ->haveReadSupport ()) {
405
407
$ 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" ' );
407
409
}
408
410
$ this ->callback = $ this ->buildCallback ($ callback );
409
411
}
@@ -433,8 +435,9 @@ public function wait(callable $callback = null)
433
435
* from the output in real-time while writing the standard input to the process.
434
436
* It allows to have feedback from the independent process during execution.
435
437
*
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
438
441
*/
439
442
public function waitUntil (callable $ callback ): bool
440
443
{
@@ -443,7 +446,7 @@ public function waitUntil(callable $callback): bool
443
446
444
447
if (!$ this ->processPipes ->haveReadSupport ()) {
445
448
$ 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". ' );
447
450
}
448
451
$ callback = $ this ->buildCallback ($ callback );
449
452
0 commit comments