Total Complexity | 5 |
Total Lines | 58 |
Duplicated Lines | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
10 | class ResponseEvent |
||
11 | { |
||
12 | private $resource; |
||
13 | |||
14 | /** |
||
15 | * @var string |
||
16 | */ |
||
17 | private $acceptHeader; |
||
18 | |||
19 | /** |
||
20 | * @var ResponseInterface|null |
||
21 | */ |
||
22 | private $response; |
||
23 | |||
24 | /** |
||
25 | * @param mixed $resource |
||
26 | * @param string $acceptHeader |
||
27 | */ |
||
28 | public function __construct($resource, string $acceptHeader) |
||
29 | { |
||
30 | $this->resource = $resource; |
||
31 | $this->acceptHeader = $acceptHeader; |
||
32 | } |
||
33 | |||
34 | /** |
||
35 | * @return ResponseInterface |
||
36 | */ |
||
37 | public function getResponse(): ?ResponseInterface |
||
38 | { |
||
39 | return $this->response; |
||
40 | } |
||
41 | |||
42 | /** |
||
43 | * @param ResponseInterface $response |
||
44 | */ |
||
45 | public function setResponse(ResponseInterface $response) |
||
48 | } |
||
49 | |||
50 | /** |
||
51 | * Get the accept header. |
||
52 | * |
||
53 | * @return string |
||
54 | */ |
||
55 | public function getAcceptHeader(): string |
||
56 | { |
||
57 | return $this->acceptHeader; |
||
58 | } |
||
59 | |||
60 | /** |
||
61 | * Get the resource. |
||
62 | * |
||
63 | * @return mixed |
||
64 | */ |
||
65 | public function getResource() |
||
68 | } |
||
69 | } |
||
70 |