1: <?php
2: /**
3: * This file is part of the Autarky package.
4: *
5: * (c) Andreas Lutro <anlutro@gmail.com>
6: *
7: * For the full copyright and license information, please view the LICENSE
8: * file that was distributed with this source code.
9: */
10:
11: namespace Autarky\Routing\Events;
12:
13: use Symfony\Component\HttpFoundation\Request;
14: use Symfony\Component\HttpFoundation\Response;
15:
16: use Autarky\Routing\Route;
17:
18: /**
19: * Event that is fired after a route's controller has been invoked, before the
20: * response is returned from the router to the HttpKernel.
21: */
22: class AfterEvent extends AbstractRouteEvent
23: {
24: /**
25: * @var Response
26: */
27: protected $response;
28:
29: /**
30: * @param Request $request
31: * @param Route $route
32: * @param Response $response
33: */
34: public function __construct(Request $request, Route $route, Response $response)
35: {
36: parent::__construct($request, $route);
37: $this->response = $response;
38: }
39:
40: /**
41: * Set the response object instance.
42: *
43: * @param Response $response
44: */
45: public function setResponse(Response $response)
46: {
47: $this->response = $response;
48: }
49:
50: /**
51: * Get the response object instance.
52: *
53: * @return Response
54: */
55: public function getResponse()
56: {
57: return $this->response;
58: }
59: }
60: