protected function storeCurrentUrl(ServerRequestInterface $request, StoreContract $session): StoreContract
    {
        if ($request->getMethod() === 'GET' &&
            $request->getHeaderLine('x-requested-with') !== 'XMLHttpRequest'
        ) {
            $session->setPreviousUrl((string) $request->getUri());
        }

        return $session;
    }
protected function storeCurrentUrl(ServerRequestInterface $request, StoreContract $session): StoreContract
    {
        if ($request->getMethod() === 'GET' &&
            $request->getHeaderLine('x-requested-with') !== 'XMLHttpRequest'
        ) {
            $session->setPreviousUrl((string) $request->getUri());
        }

        return $session;
    }
protected function storeCurrentUrl ( ServerRequestInterface $ request , StoreContract $ session ) : StoreContract { if ( $ request -> getMethod ( ) === 'GET' && $ request -> getHeaderLine ( 'x-requested-with' ) !== 'XMLHttpRequest' ) { $ session -> setPreviousUrl ( ( string ) $ request -> getUri ( ) ) ; } return $ session ; }
Store the current URL for the request if necessary.

@param \Psr\Http\Message\ServerRequestInterface  $request
@param \Viserio\Component\Contract\Session\Store $session

@return \Viserio\Component\Contract\Session\Store
Store the current URL for the request if necessary .