Returns a valid timeout value. Non positive values are converted to null,
meaning no timeout.

@return float|null
@throws \InvalidArgumentException
1190
private function getTimeout(): ?float
    {
        if (! is_numeric($this->option('timeout'))) {
            throw new \InvalidArgumentException('The timeout value must be a number.');
        }

        $timeout = (float) $this->option('timeout');

        return $timeout > 0 ? $timeout : null;
    }
806981
public function getConnectTimeoutMs()
    {
        $field = EnumRequestOption::CONNECT_TIMEOUT_MS;
        return isset($this->options[$field]) ? $this->options[$field] : 0;
    }
1273105
public function getValue()
    {
        try {
            return JsonValidator::validate($this->value) ? $this->value : '';
        } catch (InvalidArgumentException $e) {
            return $e->getMessage();
        }
    }
700112
protected int getTimeoutForResponse() {
        String timeout_s = null;
        int timeout;
        try {
            timeout_s = this.getAttributeValueSmart(TIMEOUT);
            timeout = timeout_s==null?30:Integer.parseInt(timeout_s);
            if (timeout<0) timeout = 30;
        } catch (NumberFormatException e) {
            logger.severeException("Cannot parse timeout value " + timeout_s, e);
            timeout = 30;
        } catch (PropertyException e) {
            logger.severeException("Cannot read timeout attribute " + TIMEOUT, e);
            timeout = 30;
        }
        return timeout;
    }
87931
public function getValidAuthResult()
    {
        $authResult = $this->_stateMgr->get('authResult');
        /* @var AuthResult $authResult */
        if ($authResult && $authResult->isFresh($this->_config->timeout)) {
            return $authResult;
        }
        return null;
    }
713420
public function getTTL()
    {
        if (is_null($this->expiration)) {
            return null;
        }
        if ($this->expiration > $_SERVER['REQUEST_TIME']) {
            return $this->expiration - $_SERVER['REQUEST_TIME'];
        }
        return 0;
    }
1093100
public function processTime($timeout=NULL) {
		if (is_null($timeout)) {
			return $this->__process(NULL);
		} else {
			return $this->__process($timeout * 1000000);
		}
	}
1010804
public function setTimeout($timeout) {
        if (!is_int($timeout)) throw new IllegalTypeException('Illegal type of parameter $timeout: '.gettype($timeout));
        if ($timeout < 1)      throw new InvalidArgumentException('Invalid argument $timeout: '.$timeout);

        $this->timeout = $timeout;
        return $this;
    }
276709
public function isExpired()
    {
        if ($this->getExpiresAt() instanceof \DateTime) {
            return $this->getExpiresAt()->getTimestamp() < time();
        }

        if ($this->isAppAccessToken()) {
            return false;
        }

        return null;
    }
422369
public Long getSessionTimeout() {
        //  look in the login result...if it is success
        DefaultLoginResult loginResult;
        if ( loginContext != null && (loginResult = loginContext.getLoginResult()) != null) {
            Long sessionTimeout = loginResult.getSessionTimeout();
            if ( sessionTimeout != null && sessionTimeout > 0 ) {
                return sessionTimeout;
            }
        }
        return null;
    }
171909
public function getDuration() : ?float 
    {
        if ( ! $this->hasDuration()) {
            $this->setDuration($this->getDefaultDuration());
        }
        return $this->duration;
    }
750269
public function getTtl() {

        if ( is_null($this->expiration) ) return null;

        if ( $this->expiration === 0 ) return 0;

        $now = new DateTime("now");

        if ( $now > $this->expiration ) return -1;

        return (int) $now->diff($this->expiration)->format("%r%s");

    }
58251
public long getTimeout()
  {
    if (tc.isEntryEnabled()) 
      SibTr.entry(tc, "getTimeout");
      
    long timeout = aiValueTick.getOriginalTimeout();
        
    if (tc.isEntryEnabled()) 
      SibTr.exit(tc, "getTimeout", new Long(timeout));
    return timeout;
  }
150131
public function getValue()
    {
        if (null == $this->is_valid && null != $this->user_value) {
            $this->validate();
        }
        if (null !== $this->user_value && $this->is_valid) {
            if ('' === $this->user_value && true === $this->null_on_empty) {
                return null;
            }
            return $this->user_value;
        } else {
            if ('' === $this->default_value && true === $this->null_on_empty) {
                return null;
            }
            return $this->default_value;
        }
    }
834439
public function valid()
    {

        if ($this->container['loggedAt'] === null) {
            return false;
        }
        if ($this->container['containerId'] === null) {
            return false;
        }
        if ($this->container['containerTypeId'] === null) {
            return false;
        }
        if ($this->container['characterId'] === null) {
            return false;
        }
        if ($this->container['locationId'] === null) {
            return false;
        }
        if ($this->container['locationFlag'] === null) {
            return false;
        }
        $allowedValues = $this->getLocationFlagAllowableValues();
        if (!in_array($this->container['locationFlag'], $allowedValues)) {
            return false;
        }
        if ($this->container['action'] === null) {
            return false;
        }
        $allowedValues = $this->getActionAllowableValues();
        if (!in_array($this->container['action'], $allowedValues)) {
            return false;
        }
        $allowedValues = $this->getPasswordTypeAllowableValues();
        if (!in_array($this->container['passwordType'], $allowedValues)) {
            return false;
        }
        return true;
    }
902643
public function getDefaultValue()
    {
        if (!$this->hasDefaultValue()) {
            return null;
        }

        if ($this->defaultValue instanceof FragmentInterface) {
            //Defined as SQL piece
            return $this->defaultValue;
        }

        if (in_array($this->getAbstractType(), ['time', 'date', 'datetime', 'timestamp'])) {
            return $this->formatDatetime($this->getAbstractType(), $this->defaultValue);
        }

        switch ($this->getType()) {
            case 'int':
                return (int)$this->defaultValue;
            case 'float':
                return (float)$this->defaultValue;
            case 'bool':
                if (is_string($this->defaultValue) && strtolower($this->defaultValue) == 'false') {
                    return false;
                }

                return (bool)$this->defaultValue;
        }

        return (string)$this->defaultValue;
    }
76733
public function toFloat()
    {
        if (is_array($this->value)) {
            throw new InvalidNotArrayException($this->name);
        } elseif (!empty($this->value) && !is_numeric($this->value)) {
            throw new InvalidNumericException($this->name, $this->value);
        }

        $this->value = (float) $this->value;

        return $this;
    }