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[0]) || $allParams->all($this->variableName[1]))) {
$this->groupName = $this->groupName . basename($allParams->getRequest()->getUri()->getPath());
$varName = $this->variableName[0];
if ($allParams->all($varName)) {
$this->setOption($varName, $allParams);
}
$varName = $this->variableName[1];
if ($allParams->all($varName)) {
$this->setOption($varName, $allParams);
}
}
return $next($request, $response);
}