src/Utils.php
public static function getResponseAge(ResponseInterface $response)
    {
        if ($response->hasHeader('Age')) {
            return (int) $response->getHeader('Age');
        }

        $date = strtotime($response->getHeader('Date') ?: 'now');

        return time() - $date;
    }
public static function getResponseAge(ResponseInterface $response)
    {
        if ($response->hasHeader('Age')) {
            return (int) $response->getHeader('Age');
        }

        $date = strtotime($response->getHeader('Date') ?: 'now');

        return time() - $date;
    }
public static function getResponseAge ( ResponseInterface $ response ) { if ( $ response -> hasHeader ( 'Age' ) ) { return ( int ) $ response -> getHeader ( 'Age' ) ; } $ date = strtotime ( $ response -> getHeader ( 'Date' ) ? : 'now' ) ; return time ( ) - $ date ; }
Gets the age of a response in seconds.

@param ResponseInterface $response

@return int
Gets the age of a response in seconds .