protected function getSession(Request $request) : Session\Session
    {
        $session = $request->getAttribute(SessionHandler::SESSION_ATTRIBUTE);

        if (! $session instanceof Session\Session) {
            throw new \Exception(
                'Session not available in request at: '
                . SessionHandler::SESSION_ATTRIBUTE
            );
        }
        return $session;
    }
protected function getSession(Request $request) : Session\Session
    {
        $session = $request->getAttribute(SessionHandler::SESSION_ATTRIBUTE);

        if (! $session instanceof Session\Session) {
            throw new \Exception(
                'Session not available in request at: '
                . SessionHandler::SESSION_ATTRIBUTE
            );
        }
        return $session;
    }
protected function getSession ( Request $ request ) : Session \ Session { $ session = $ request -> getAttribute ( SessionHandler :: SESSION_ATTRIBUTE ) ; if ( ! $ session instanceof Session \ Session ) { throw new \ Exception ( 'Session not available in request at: ' . SessionHandler :: SESSION_ATTRIBUTE ) ; } return $ session ; }
Get session from request

@param Request $request PSR7 Request

@return Session\Session
@throws Exception if session attribute is invalid

@access protected
Get session from request