Skip to content

Commit

Permalink
Merge branch '5.0'
Browse files Browse the repository at this point in the history
* 5.0:
  [String] add test case for wordwrap method
  [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
  • Loading branch information
nicolas-grekas committed Jan 9, 2020
2 parents d471271 + f9ffd87 commit 7075b84
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions Process.php
Expand Up @@ -135,7 +135,7 @@ class Process implements \IteratorAggregate
* @param mixed|null $input The input as stream resource, scalar or \Traversable, or null for no input
* @param int|float|null $timeout The timeout in seconds or null to disable
*
* @throws RuntimeException When proc_open is not installed
* @throws LogicException When proc_open is not installed
*/
public function __construct(array $command, string $cwd = null, array $env = null, $input = null, ?float $timeout = 60)
{
Expand Down Expand Up @@ -184,7 +184,7 @@ public function __construct(array $command, string $cwd = null, array $env = nul
*
* @return static
*
* @throws RuntimeException When proc_open is not installed
* @throws LogicException When proc_open is not installed
*/
public static function fromShellCommandline(string $command, string $cwd = null, array $env = null, $input = null, ?float $timeout = 60)
{
Expand Down Expand Up @@ -219,9 +219,11 @@ public function __clone()
*
* @return int The exit status code
*
* @throws RuntimeException When process can't be launched
* @throws RuntimeException When process stopped after receiving signal
* @throws LogicException In case a callback is provided and output has been disabled
* @throws RuntimeException When process can't be launched
* @throws RuntimeException When process is already running
* @throws ProcessTimedOutException When process timed out
* @throws ProcessSignaledException When process stopped after receiving signal
* @throws LogicException In case a callback is provided and output has been disabled
*
* @final
*/
Expand Down Expand Up @@ -389,9 +391,9 @@ public function restart(callable $callback = null, array $env = []): self
*
* @return int The exitcode of the process
*
* @throws RuntimeException When process timed out
* @throws RuntimeException When process stopped after receiving signal
* @throws LogicException When process is not yet started
* @throws ProcessTimedOutException When process timed out
* @throws ProcessSignaledException When process stopped after receiving signal
* @throws LogicException When process is not yet started
*/
public function wait(callable $callback = null)
{
Expand All @@ -402,7 +404,7 @@ public function wait(callable $callback = null)
if (null !== $callback) {
if (!$this->processPipes->haveReadSupport()) {
$this->stop(0);
throw new \LogicException('Pass the callback to the "Process::start" method or call enableOutput to use a callback with "Process::wait"');
throw new LogicException('Pass the callback to the "Process::start" method or call enableOutput to use a callback with "Process::wait"');
}
$this->callback = $this->buildCallback($callback);
}
Expand Down Expand Up @@ -432,8 +434,9 @@ public function wait(callable $callback = null)
* from the output in real-time while writing the standard input to the process.
* It allows to have feedback from the independent process during execution.
*
* @throws RuntimeException When process timed out
* @throws LogicException When process is not yet started
* @throws RuntimeException When process timed out
* @throws LogicException When process is not yet started
* @throws ProcessTimedOutException In case the timeout was reached
*/
public function waitUntil(callable $callback): bool
{
Expand All @@ -442,7 +445,7 @@ public function waitUntil(callable $callback): bool

if (!$this->processPipes->haveReadSupport()) {
$this->stop(0);
throw new \LogicException('Pass the callback to the "Process::start" method or call enableOutput to use a callback with "Process::waitUntil".');
throw new LogicException('Pass the callback to the "Process::start" method or call enableOutput to use a callback with "Process::waitUntil".');
}
$callback = $this->buildCallback($callback);

Expand Down

0 comments on commit 7075b84

Please sign in to comment.