@@ -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
*/
@@ -393,9 +395,9 @@ public function restart(callable $callback = null, array $env = []): self
393
395
*
394
396
* @return int The exitcode of the process
395
397
*
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
399
401
*/
400
402
public function wait (callable $ callback = null )
401
403
{
@@ -406,7 +408,7 @@ public function wait(callable $callback = null)
406
408
if (null !== $ callback ) {
407
409
if (!$ this ->processPipes ->haveReadSupport ()) {
408
410
$ 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" ' );
410
412
}
411
413
$ this ->callback = $ this ->buildCallback ($ callback );
412
414
}
@@ -436,8 +438,9 @@ public function wait(callable $callback = null)
436
438
* from the output in real-time while writing the standard input to the process.
437
439
* It allows to have feedback from the independent process during execution.
438
440
*
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
441
444
*/
442
445
public function waitUntil (callable $ callback ): bool
443
446
{
@@ -446,7 +449,7 @@ public function waitUntil(callable $callback): bool
446
449
447
450
if (!$ this ->processPipes ->haveReadSupport ()) {
448
451
$ 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". ' );
450
453
}
451
454
$ callback = $ this ->buildCallback ($ callback );
452
455
0 commit comments