public function location($url = null)
    {
        deprecationWarning(
            'Response::location() is deprecated. ' .
            'Mutable responses are deprecated. Use `withLocation()` and `getHeaderLine()` instead.'
        );

        if ($url === null) {
            $result = $this->getHeaderLine('Location');
            if (!$result) {
                return null;
            }

            return $result;
        }
        if ($this->_status === 200) {
            $this->_status = 302;
        }
        $this->_setHeader('Location', $url);

        return null;
    }
public function location($url = null)
    {
        deprecationWarning(
            'Response::location() is deprecated. ' .
            'Mutable responses are deprecated. Use `withLocation()` and `getHeaderLine()` instead.'
        );

        if ($url === null) {
            $result = $this->getHeaderLine('Location');
            if (!$result) {
                return null;
            }

            return $result;
        }
        if ($this->_status === 200) {
            $this->_status = 302;
        }
        $this->_setHeader('Location', $url);

        return null;
    }
public function location ( $ url = null ) { deprecationWarning ( 'Response::location() is deprecated. ' . 'Mutable responses are deprecated. Use `withLocation()` and `getHeaderLine()` instead.' ) ; if ( $ url === null ) { $ result = $ this -> getHeaderLine ( 'Location' ) ; if ( ! $ result ) { return null ; } return $ result ; } if ( $ this -> _status === 200 ) { $ this -> _status = 302 ; } $ this -> _setHeader ( 'Location' , $ url ) ; return null ; }
Accessor for the location header.

Get/Set the Location header value.

@param null|string $url Either null to get the current location, or a string to set one.
@return string|null When setting the location null will be returned. When reading the location
a string of the current location header value (if any) will be returned.
@deprecated 3.4.0 Mutable responses are deprecated. Use `withLocation()` and `getHeaderLine()`
instead.
Accessor for the location header .