Passed
Pull Request — master (#43)
by Akmal
01:43
created

AfterCallActionEvent::setResponse()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
c 0
b 0
f 0
rs 10
cc 1
nc 1
nop 1
1
<?php declare(strict_types=1);
2
3
namespace OpenEngine\Mika\Core\Components\Route\Events;
4
5
use Psr\Http\Message\ResponseInterface;
6
7
/**
8
 * Event will be triggered by Route after calling controller action
9
 *
10
 * @package OpenEngine\Mika\Core\Components\Route\Events
11
 */
12
class AfterCallActionEvent extends CallActionEventAbstract
13
{
14
    /**
15
     * @var ResponseInterface
16
     */
17
    private $response;
18
19
    /**
20
     * AfterCallActionEvent constructor.
21
     * @param string $controllerName
22
     * @param string $actionName
23
     * @param array $actionParams
24
     * @param $response
25
     */
26
    public function __construct(string $controllerName, string $actionName, array $actionParams, $response)
27
    {
28
        $this->response = $response;
29
30
        parent::__construct($controllerName, $actionName, $actionParams);
31
    }
32
33
    /**
34
     * @return ResponseInterface
35
     */
36
    public function getResponse(): ResponseInterface
37
    {
38
        return $this->response;
39
    }
40
41
    /**
42
     * @param ResponseInterface $response
43
     */
44
    public function setResponse(ResponseInterface $response): void
45
    {
46
        $this->response = $response;
47
    }
48
}
49