Skip to content

Commit f9ffd87

Browse files
Merge branch '4.4' into 5.0
* 4.4: [Process] - update @throws phpdoc [PHPUnitBridge] file_get_contents() expects parameter 3 to be resource [PHPUnit-Bridge] Fail-fast in simple-phpunit if one of the passthru() commands fails [HttpKernel][FileLocator] Fix deprecation message
2 parents 18afb55 + f5697ab commit f9ffd87

File tree

1 file changed

+15
-12
lines changed

1 file changed

+15
-12
lines changed

Process.php

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -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(array $command, string $cwd = null, array $env = null, $input = null, ?float $timeout = 60)
141141
{
@@ -184,7 +184,7 @@ public function __construct(array $command, string $cwd = null, array $env = nul
184184
*
185185
* @return static
186186
*
187-
* @throws RuntimeException When proc_open is not installed
187+
* @throws LogicException When proc_open is not installed
188188
*/
189189
public static function fromShellCommandline(string $command, string $cwd = null, array $env = null, $input = null, ?float $timeout = 60)
190190
{
@@ -219,9 +219,11 @@ public function __clone()
219219
*
220220
* @return int The exit status code
221221
*
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
225227
*
226228
* @final
227229
*/
@@ -389,9 +391,9 @@ public function restart(callable $callback = null, array $env = []): self
389391
*
390392
* @return int The exitcode of the process
391393
*
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
395397
*/
396398
public function wait(callable $callback = null)
397399
{
@@ -402,7 +404,7 @@ public function wait(callable $callback = null)
402404
if (null !== $callback) {
403405
if (!$this->processPipes->haveReadSupport()) {
404406
$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"');
406408
}
407409
$this->callback = $this->buildCallback($callback);
408410
}
@@ -432,8 +434,9 @@ public function wait(callable $callback = null)
432434
* from the output in real-time while writing the standard input to the process.
433435
* It allows to have feedback from the independent process during execution.
434436
*
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
437440
*/
438441
public function waitUntil(callable $callback): bool
439442
{
@@ -442,7 +445,7 @@ public function waitUntil(callable $callback): bool
442445

443446
if (!$this->processPipes->haveReadSupport()) {
444447
$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".');
446449
}
447450
$callback = $this->buildCallback($callback);
448451

0 commit comments

Comments
 (0)