public function expires($time = null)
    {
        deprecationWarning(
            'Response::expires() is deprecated. ' .
            'Use withExpires() instead.'
        );

        if ($time !== null) {
            $date = $this->_getUTCDate($time);
            $this->_setHeader('Expires', $date->format('D, j M Y H:i:s') . ' GMT');
        }

        if ($this->hasHeader('Expires')) {
            return $this->getHeaderLine('Expires');
        }

        return null;
    }
public function expires($time = null)
    {
        deprecationWarning(
            'Response::expires() is deprecated. ' .
            'Use withExpires() instead.'
        );

        if ($time !== null) {
            $date = $this->_getUTCDate($time);
            $this->_setHeader('Expires', $date->format('D, j M Y H:i:s') . ' GMT');
        }

        if ($this->hasHeader('Expires')) {
            return $this->getHeaderLine('Expires');
        }

        return null;
    }
public function expires ( $ time = null ) { deprecationWarning ( 'Response::expires() is deprecated. ' . 'Use withExpires() instead.' ) ; if ( $ time !== null ) { $ date = $ this -> _getUTCDate ( $ time ) ; $ this -> _setHeader ( 'Expires' , $ date -> format ( 'D, j M Y H:i:s' ) . ' GMT' ) ; } if ( $ this -> hasHeader ( 'Expires' ) ) { return $ this -> getHeaderLine ( 'Expires' ) ; } return null ; }
Sets the Expires header for the response by taking an expiration time
If called with no parameters it will return the current Expires value

### Examples:

`$response->expires('now')` Will Expire the response cache now
`$response->expires(new DateTime('+1 day'))` Will set the expiration in next 24 hours
`$response->expires()` Will return the current expiration header value

@param string|\DateTimeInterface|null $time Valid time string or \DateTime instance.
@return string|null
@deprecated 3.4.0 Use withExpires() instead.
Sets the Expires header for the response by taking an expiration time If called with no parameters it will return the current Expires value