update patch 1
This commit is contained in:
@@ -23,15 +23,11 @@ class ProcessTimedOutException extends RuntimeException
|
||||
public const TYPE_GENERAL = 1;
|
||||
public const TYPE_IDLE = 2;
|
||||
|
||||
private Process $process;
|
||||
private int $timeoutType;
|
||||
|
||||
public function __construct(Process $process, int $timeoutType)
|
||||
{
|
||||
$this->process = $process;
|
||||
$this->timeoutType = $timeoutType;
|
||||
|
||||
parent::__construct(sprintf(
|
||||
public function __construct(
|
||||
private Process $process,
|
||||
private int $timeoutType,
|
||||
) {
|
||||
parent::__construct(\sprintf(
|
||||
'The process "%s" exceeded the timeout of %s seconds.',
|
||||
$process->getCommandLine(),
|
||||
$this->getExceededTimeout()
|
||||
@@ -58,7 +54,7 @@ class ProcessTimedOutException extends RuntimeException
|
||||
return match ($this->timeoutType) {
|
||||
self::TYPE_GENERAL => $this->process->getTimeout(),
|
||||
self::TYPE_IDLE => $this->process->getIdleTimeout(),
|
||||
default => throw new \LogicException(sprintf('Unknown timeout type "%d".', $this->timeoutType)),
|
||||
default => throw new \LogicException(\sprintf('Unknown timeout type "%d".', $this->timeoutType)),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user