Skip to content

Commit b9863d5

Browse files
committed
[HttpKernel] PostResponseEvent should extend the KernelEvent
1 parent 9a1574a commit b9863d5

File tree

1 file changed

+6
-33
lines changed

1 file changed

+6
-33
lines changed

src/Symfony/Component/HttpKernel/Event/PostResponseEvent.php

Lines changed: 6 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -12,53 +12,26 @@
1212
namespace Symfony\Component\HttpKernel\Event;
1313

1414
use Symfony\Component\HttpKernel\HttpKernelInterface;
15-
use Symfony\Component\EventDispatcher\Event;
1615
use Symfony\Component\HttpFoundation\Request;
1716
use Symfony\Component\HttpFoundation\Response;
1817

1918
/**
2019
* Allows to execute logic after a response was sent.
2120
*
21+
* Since it's only triggered on master requests, the `getRequestType()` method
22+
* will always return the value of `HttpKernelInterface::MASTER_REQUEST`.
23+
*
2224
* @author Jordi Boggiano <j.boggiano@seld.be>
2325
*/
24-
class PostResponseEvent extends Event
26+
class PostResponseEvent extends KernelEvent
2527
{
26-
/**
27-
* The kernel in which this event was thrown.
28-
*
29-
* @var HttpKernelInterface
30-
*/
31-
private $kernel;
32-
33-
private $request;
34-
3528
private $response;
3629

3730
public function __construct(HttpKernelInterface $kernel, Request $request, Response $response)
3831
{
39-
$this->kernel = $kernel;
40-
$this->request = $request;
41-
$this->response = $response;
42-
}
32+
parent::__construct($kernel, $request, HttpKernelInterface::MASTER_REQUEST);
4333

44-
/**
45-
* Returns the kernel in which this event was thrown.
46-
*
47-
* @return HttpKernelInterface
48-
*/
49-
public function getKernel()
50-
{
51-
return $this->kernel;
52-
}
53-
54-
/**
55-
* Returns the request for which this event was thrown.
56-
*
57-
* @return Request
58-
*/
59-
public function getRequest()
60-
{
61-
return $this->request;
34+
$this->response = $response;
6235
}
6336

6437
/**

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy