Storage/src/SigningHelper.php
private function normalizeExpiration($expires)
    {
        if ($expires instanceof Timestamp) {
            $seconds = $expires->get()->format('U');
        } elseif ($expires instanceof \DateTimeInterface) {
            $seconds = $expires->format('U');
        } elseif (is_numeric($expires)) {
            $seconds = (int) $expires;
        } else {
            throw new \InvalidArgumentException('Invalid expiration.');
        }

        return $seconds;
    }
private function normalizeExpiration($expires)
    {
        if ($expires instanceof Timestamp) {
            $seconds = $expires->get()->format('U');
        } elseif ($expires instanceof \DateTimeInterface) {
            $seconds = $expires->format('U');
        } elseif (is_numeric($expires)) {
            $seconds = (int) $expires;
        } else {
            throw new \InvalidArgumentException('Invalid expiration.');
        }

        return $seconds;
    }
private function normalizeExpiration ( $ expires ) { if ( $ expires instanceof Timestamp ) { $ seconds = $ expires -> get ( ) -> format ( 'U' ) ; } elseif ( $ expires instanceof \ DateTimeInterface ) { $ seconds = $ expires -> format ( 'U' ) ; } elseif ( is_numeric ( $ expires ) ) { $ seconds = ( int ) $ expires ; } else { throw new \ InvalidArgumentException ( 'Invalid expiration.' ) ; } return $ seconds ; }
Normalizes and validates an expiration.

@param Timestamp|\DateTimeInterface|int $expires The expiration
@return int
@throws \InvalidArgumentException If an invalid value is given.
Normalizes and validates an expiration .