Uploadcare\Exceptions\ThrottledRequestException::getTimeout PHP Method

getTimeout() public method

public getTimeout ( ) : integer
return integer
    public function getTimeout()
    {
        if ($this->isWaitHeaderSet()) {
            return (int) $this->responseHeaders['x-throttle-wait-seconds'];
        }
        return self::DEFAULT_TIMEOUT;
    }

Usage Example

 /**
  * @param array $headers
  * @dataProvider headersProvider
  */
 public function testDefaultTimeoutIsRetrievedIfNoHeaderIsSet($headers)
 {
     if (is_array($headers)) {
         $this->throttled_request_exception->setResponseHeaders($headers);
     }
     $this->assertEquals(ThrottledRequestException::DEFAULT_TIMEOUT, $this->throttled_request_exception->getTimeout());
 }