public function __invoke(Request $request, Response $response, $next) { $this->req = $request; $this->res = $response; $allParams = new RequestParams($this->req); if (Session::has('auth') && Session::get('auth') && $allParams->all($this->variableName)) { $this->setOption($allParams->all($this->variableName), $allParams); } return $next($request, $response); }