protected function populateGlobals(string
$method,
$request, ?array
$params = null
) { // $params should set the query vars if present,
// otherwise set it from the URL.
$get = !
empty($params) &&
$method === 'get'
?
$params :
$this->
getPrivateProperty($request->
getUri(), 'query'
);
$request->
setGlobal('get',
$get);
if ($method !== 'get'
) { $request->
setGlobal($method,
$params);
} $request->
setGlobal('request',
$params);
$_SESSION =
$this->session ??
[];
return $request;
}