src/PhpSigep/Cache/Storage/Adapter/AdapterOptions.php
protected function normalizeTtl(&$ttl)
    {
        if (!is_int($ttl)) {
            $ttl = (float)$ttl;

            // convert to int if possible
            if ($ttl === (float)(int)$ttl) {
                $ttl = (int)$ttl;
            }
        }

        if ($ttl < 0) {
            throw new InvalidArgumentException("TTL can't be negative");
        }
    }
protected function normalizeTtl(&$ttl)
    {
        if (!is_int($ttl)) {
            $ttl = (float)$ttl;

            // convert to int if possible
            if ($ttl === (float)(int)$ttl) {
                $ttl = (int)$ttl;
            }
        }

        if ($ttl < 0) {
            throw new InvalidArgumentException("TTL can't be negative");
        }
    }
protected function normalizeTtl ( & $ ttl ) { if ( ! is_int ( $ ttl ) ) { $ ttl = ( float ) $ ttl ; // convert to int if possible if ( $ ttl === ( float ) ( int ) $ ttl ) { $ ttl = ( int ) $ ttl ; } } if ( $ ttl < 0 ) { throw new InvalidArgumentException ( "TTL can't be negative" ) ; } }
Validates and normalize a TTL.

@param  int|float $ttl
@throws InvalidArgumentException
@return void
Validates and normalize a TTL .