diff options
Diffstat (limited to 'vendor/react/promise-timer/src/TimeoutException.php')
-rw-r--r-- | vendor/react/promise-timer/src/TimeoutException.php | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/vendor/react/promise-timer/src/TimeoutException.php b/vendor/react/promise-timer/src/TimeoutException.php new file mode 100644 index 0000000..7f03ba0 --- /dev/null +++ b/vendor/react/promise-timer/src/TimeoutException.php @@ -0,0 +1,35 @@ +<?php + +namespace React\Promise\Timer; + +use RuntimeException; + +class TimeoutException extends RuntimeException +{ + /** @var float */ + private $timeout; + + /** + * @param float $timeout + * @param string|null $message + * @param int|null $code + * @param null|\Exception|\Throwable $previous + */ + public function __construct($timeout, $message = '', $code = 0, $previous = null) + { + // Preserve compatibility with our former nullable signature, but avoid invalid arguments for the parent constructor: + parent::__construct((string) $message, (int) $code, $previous); + + $this->timeout = (float) $timeout; + } + + /** + * Get the timeout value in seconds. + * + * @return float + */ + public function getTimeout() + { + return $this->timeout; + } +} |