@@ -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 (array $ command , string $ cwd = null , array $ env = null , $ input = null , ?float $ timeout = 60 )
141
141
{
@@ -184,7 +184,7 @@ public function __construct(array $command, string $cwd = null, array $env = nul
184
184
*
185
185
* @return static
186
186
*
187
- * @throws RuntimeException When proc_open is not installed
187
+ * @throws LogicException When proc_open is not installed
188
188
*/
189
189
public static function fromShellCommandline (string $ command , string $ cwd = null , array $ env = null , $ input = null , ?float $ timeout = 60 )
190
190
{
@@ -219,9 +219,11 @@ public function __clone()
219
219
*
220
220
* @return int The exit status code
221
221
*
222
- * @throws RuntimeException When process can't be launched
223
- * @throws RuntimeException When process stopped after receiving signal
224
- * @throws LogicException In case a callback is provided and output has been disabled
222
+ * @throws RuntimeException When process can't be launched
223
+ * @throws RuntimeException When process is already running
224
+ * @throws ProcessTimedOutException When process timed out
225
+ * @throws ProcessSignaledException When process stopped after receiving signal
226
+ * @throws LogicException In case a callback is provided and output has been disabled
225
227
*
226
228
* @final
227
229
*/
@@ -389,9 +391,9 @@ public function restart(callable $callback = null, array $env = []): self
389
391
*
390
392
* @return int The exitcode of the process
391
393
*
392
- * @throws RuntimeException When process timed out
393
- * @throws RuntimeException When process stopped after receiving signal
394
- * @throws LogicException When process is not yet started
394
+ * @throws ProcessTimedOutException When process timed out
395
+ * @throws ProcessSignaledException When process stopped after receiving signal
396
+ * @throws LogicException When process is not yet started
395
397
*/
396
398
public function wait (callable $ callback = null )
397
399
{
@@ -402,7 +404,7 @@ public function wait(callable $callback = null)
402
404
if (null !== $ callback ) {
403
405
if (!$ this ->processPipes ->haveReadSupport ()) {
404
406
$ this ->stop (0 );
405
- throw new \ LogicException ('Pass the callback to the "Process::start" method or call enableOutput to use a callback with "Process::wait" ' );
407
+ throw new LogicException ('Pass the callback to the "Process::start" method or call enableOutput to use a callback with "Process::wait" ' );
406
408
}
407
409
$ this ->callback = $ this ->buildCallback ($ callback );
408
410
}
@@ -432,8 +434,9 @@ public function wait(callable $callback = null)
432
434
* from the output in real-time while writing the standard input to the process.
433
435
* It allows to have feedback from the independent process during execution.
434
436
*
435
- * @throws RuntimeException When process timed out
436
- * @throws LogicException When process is not yet started
437
+ * @throws RuntimeException When process timed out
438
+ * @throws LogicException When process is not yet started
439
+ * @throws ProcessTimedOutException In case the timeout was reached
437
440
*/
438
441
public function waitUntil (callable $ callback ): bool
439
442
{
@@ -442,7 +445,7 @@ public function waitUntil(callable $callback): bool
442
445
443
446
if (!$ this ->processPipes ->haveReadSupport ()) {
444
447
$ this ->stop (0 );
445
- throw new \ LogicException ('Pass the callback to the "Process::start" method or call enableOutput to use a callback with "Process::waitUntil". ' );
448
+ throw new LogicException ('Pass the callback to the "Process::start" method or call enableOutput to use a callback with "Process::waitUntil". ' );
446
449
}
447
450
$ callback = $ this ->buildCallback ($ callback );
448
451
0 commit comments