protected function normalizeExpires($expiration = null): int
    {
        $expires   = $this->getTimestamp($expiration);
        $tsExpires = $expires;

        if (\is_string($expires)) {
            $tsExpires = \strtotime($expires);
            $is32Bit   = \PHP_INT_SIZE <= 4;

            // if $tsExpires is invalid and PHP is compiled as 32bit. Check if it fail reason is the 2038 bug
            if ($is32Bit && ! \is_int($tsExpires)) {
                $dateTime = new Chronos($expires);

                if ($dateTime->format('Y') > 2038) {
                    $tsExpires = \PHP_INT_MAX;
                }
            }
        }

        if (! \is_int($tsExpires) || $tsExpires < 0) {
            throw new InvalidArgumentException('Invalid expires time specified.');
        }

        return $tsExpires;
    }
protected function normalizeExpires($expiration = null): int
    {
        $expires   = $this->getTimestamp($expiration);
        $tsExpires = $expires;

        if (\is_string($expires)) {
            $tsExpires = \strtotime($expires);
            $is32Bit   = \PHP_INT_SIZE <= 4;

            // if $tsExpires is invalid and PHP is compiled as 32bit. Check if it fail reason is the 2038 bug
            if ($is32Bit && ! \is_int($tsExpires)) {
                $dateTime = new Chronos($expires);

                if ($dateTime->format('Y') > 2038) {
                    $tsExpires = \PHP_INT_MAX;
                }
            }
        }

        if (! \is_int($tsExpires) || $tsExpires < 0) {
            throw new InvalidArgumentException('Invalid expires time specified.');
        }

        return $tsExpires;
    }
protected function normalizeExpires ( $ expiration = null ) : int { $ expires = $ this -> getTimestamp ( $ expiration ) ; $ tsExpires = $ expires ; if ( \ is_string ( $ expires ) ) { $ tsExpires = \ strtotime ( $ expires ) ; $ is32Bit = \ PHP_INT_SIZE <= 4 ; // if $tsExpires is invalid and PHP is compiled as 32bit. Check if it fail reason is the 2038 bug if ( $ is32Bit && ! \ is_int ( $ tsExpires ) ) { $ dateTime = new Chronos ( $ expires ) ; if ( $ dateTime -> format ( 'Y' ) > 2038 ) { $ tsExpires = \ PHP_INT_MAX ; } } } if ( ! \ is_int ( $ tsExpires ) || $ tsExpires < 0 ) { throw new InvalidArgumentException ( 'Invalid expires time specified.' ) ; } return $ tsExpires ; }
Normalizes the expiration value.

@param null|\DateTimeInterface|int|string $expiration

@throws \Viserio\Component\Contract\Cookie\Exception\InvalidArgumentException

@return int
Normalizes the expiration value .