You have injected the Request via parameter $request. This is generally not recommended as there might be multiple instances during a request cycle (f.e. when using sub-requests). Instead, it is recommended to inject the RequestStack and retrieve the current request each time you need it via getCurrentRequest().
Loading history...
15
{
16
1
$this->request = $request;
17
1
}
18
19
1
public function getMethod(): string
20
{
21
1
return $this->request->getMethod();
22
}
23
24
/**
25
* helper method to build a uri without reordering url parameters in a query string alphabetically
26
* which the interal Request::getUri function does (called normalize)