The class Symfony\Component\EventDispatcher\Event has been deprecated with message: since Symfony 4.3, use "Symfony\Contracts\EventDispatcher\Event" instead
This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the type will be
removed from the class and what other constant to use instead.
Loading history...
12
{
13
/** @var Request */
14
private $request;
15
/** @var PageInterface */
16
private $page;
17
/** @var RenderContext */
18
private $renderContext;
19
/** @var Response|null */
20
private $response;
21
22
public function __construct(Request $request, PageInterface $page, RenderContext $renderContext)
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...
23
{
24
$this->request = $request;
25
$this->page = $page;
26
$this->renderContext = $renderContext;
27
}
28
29
public function getRequest(): Request
30
{
31
return $this->request;
32
}
33
34
public function getPage(): PageInterface
35
{
36
return $this->page;
37
}
38
39
public function &getRenderContext(): RenderContext
40
{
41
return $this->renderContext;
42
}
43
44
public function getResponse(): ?Response
45
{
46
return $this->response;
47
}
48
49
public function setResponse(Response $response): void
This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.