Chris@0: Chris@0: * Chris@0: * For the full copyright and license information, please view the LICENSE Chris@0: * file that was distributed with this source code. Chris@0: */ Chris@0: Chris@0: namespace Symfony\Component\HttpKernel\Event; Chris@0: Chris@0: use Symfony\Component\HttpFoundation\Request; Chris@0: use Symfony\Component\HttpFoundation\Response; Chris@17: use Symfony\Component\HttpKernel\HttpKernelInterface; Chris@0: Chris@0: /** Chris@0: * Allows to execute logic after a response was sent. Chris@0: * Chris@0: * Since it's only triggered on master requests, the `getRequestType()` method Chris@0: * will always return the value of `HttpKernelInterface::MASTER_REQUEST`. Chris@0: * Chris@0: * @author Jordi Boggiano Chris@0: */ Chris@0: class PostResponseEvent extends KernelEvent Chris@0: { Chris@0: private $response; Chris@0: Chris@0: public function __construct(HttpKernelInterface $kernel, Request $request, Response $response) Chris@0: { Chris@0: parent::__construct($kernel, $request, HttpKernelInterface::MASTER_REQUEST); Chris@0: Chris@0: $this->response = $response; Chris@0: } Chris@0: Chris@0: /** Chris@0: * Returns the response for which this event was thrown. Chris@0: * Chris@0: * @return Response Chris@0: */ Chris@0: public function getResponse() Chris@0: { Chris@0: return $this->response; Chris@0: } Chris@0: }