public function vary($cacheVariances = null)
    {
        deprecationWarning(
            'Response::vary() is deprecated. ' .
            'Use withVary() instead.'
        );

        if ($cacheVariances !== null) {
            $cacheVariances = (array)$cacheVariances;
            $this->_setHeader('Vary', implode(', ', $cacheVariances));
        }

        if ($this->hasHeader('Vary')) {
            return explode(', ', $this->getHeaderLine('Vary'));
        }

        return null;
    }
public function vary($cacheVariances = null)
    {
        deprecationWarning(
            'Response::vary() is deprecated. ' .
            'Use withVary() instead.'
        );

        if ($cacheVariances !== null) {
            $cacheVariances = (array)$cacheVariances;
            $this->_setHeader('Vary', implode(', ', $cacheVariances));
        }

        if ($this->hasHeader('Vary')) {
            return explode(', ', $this->getHeaderLine('Vary'));
        }

        return null;
    }
public function vary ( $ cacheVariances = null ) { deprecationWarning ( 'Response::vary() is deprecated. ' . 'Use withVary() instead.' ) ; if ( $ cacheVariances !== null ) { $ cacheVariances = ( array ) $ cacheVariances ; $ this -> _setHeader ( 'Vary' , implode ( ', ' , $ cacheVariances ) ) ; } if ( $ this -> hasHeader ( 'Vary' ) ) { return explode ( ', ' , $ this -> getHeaderLine ( 'Vary' ) ) ; } return null ; }
Sets the Vary header for the response, if an array is passed,
values will be imploded into a comma separated string. If no
parameters are passed, then an array with the current Vary header
value is returned

@param string|array|null $cacheVariances A single Vary string or an array
containing the list for variances.
@return array|null
@deprecated 3.4.0 Use withVary() instead.
Sets the Vary header for the response if an array is passed values will be imploded into a comma separated string . If no parameters are passed then an array with the current Vary header value is returned