From b9863d521dfb7afc5db33e77cdb3cd9fdcf969b2 Mon Sep 17 00:00:00 2001 From: Jakub Zalas Date: Mon, 2 Nov 2015 21:50:51 +0000 Subject: [PATCH] [HttpKernel] PostResponseEvent should extend the KernelEvent --- .../HttpKernel/Event/PostResponseEvent.php | 39 +++---------------- 1 file changed, 6 insertions(+), 33 deletions(-) diff --git a/src/Symfony/Component/HttpKernel/Event/PostResponseEvent.php b/src/Symfony/Component/HttpKernel/Event/PostResponseEvent.php index 5d4450b357c5f..2406fddbe89db 100644 --- a/src/Symfony/Component/HttpKernel/Event/PostResponseEvent.php +++ b/src/Symfony/Component/HttpKernel/Event/PostResponseEvent.php @@ -12,53 +12,26 @@ namespace Symfony\Component\HttpKernel\Event; use Symfony\Component\HttpKernel\HttpKernelInterface; -use Symfony\Component\EventDispatcher\Event; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; /** * Allows to execute logic after a response was sent. * + * Since it's only triggered on master requests, the `getRequestType()` method + * will always return the value of `HttpKernelInterface::MASTER_REQUEST`. + * * @author Jordi Boggiano */ -class PostResponseEvent extends Event +class PostResponseEvent extends KernelEvent { - /** - * The kernel in which this event was thrown. - * - * @var HttpKernelInterface - */ - private $kernel; - - private $request; - private $response; public function __construct(HttpKernelInterface $kernel, Request $request, Response $response) { - $this->kernel = $kernel; - $this->request = $request; - $this->response = $response; - } + parent::__construct($kernel, $request, HttpKernelInterface::MASTER_REQUEST); - /** - * Returns the kernel in which this event was thrown. - * - * @return HttpKernelInterface - */ - public function getKernel() - { - return $this->kernel; - } - - /** - * Returns the request for which this event was thrown. - * - * @return Request - */ - public function getRequest() - { - return $this->request; + $this->response = $response; } /** 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