public function getPreviousUrl(bool $fallBackToReferer = true) : string
    {
        if (!empty($this->previousUrl)) {
            return $this->previousUrl;
        }

        if ($fallBackToReferer) {
            return $this->headers->get('REFERER', '');
        }

        return '';
    }
public function getPreviousUrl(bool $fallBackToReferer = true) : string
    {
        if (!empty($this->previousUrl)) {
            return $this->previousUrl;
        }

        if ($fallBackToReferer) {
            return $this->headers->get('REFERER', '');
        }

        return '';
    }
public function getPreviousUrl ( bool $ fallBackToReferer = true ) : string { if ( ! empty ( $ this -> previousUrl ) ) { return $ this -> previousUrl ; } if ( $ fallBackToReferer ) { return $ this -> headers -> get ( 'REFERER' , '' ) ; } return '' ; }
The previous URL, if one was set, otherwise the referrer header

@param bool $fallBackToReferer True if we fall back to the HTTP referer header, otherwise false
@return string The previous URL
The previous URL if one was set otherwise the referrer header