function Process::validateTimeout
Validates and returns the filtered timeout.
Throws
InvalidArgumentException if the given timeout is a negative number
2 calls to Process::validateTimeout()
- Process::setIdleTimeout in vendor/
symfony/ process/ Process.php - Sets the process idle timeout (max. time since last output) in seconds.
- Process::setTimeout in vendor/
symfony/ process/ Process.php - Sets the process timeout (max. runtime) in seconds.
File
-
vendor/
symfony/ process/ Process.php, line 1397
Class
- Process
- Process is a thin wrapper around proc_* functions to easily start independent PHP processes.
Namespace
Symfony\Component\ProcessCode
private function validateTimeout(?float $timeout) : ?float {
$timeout = (double) $timeout;
if (0.0 === $timeout) {
$timeout = null;
}
elseif ($timeout < 0) {
throw new InvalidArgumentException('The timeout value must be a valid positive integer or float number.');
}
return $timeout;
}