Total Complexity | 3 |
Total Lines | 24 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
17 | trait RequestAwareEventTrait |
||
18 | { |
||
19 | /** |
||
20 | * Returns PHP environment execution request. |
||
21 | * |
||
22 | * @return RequestInterface |
||
23 | * @throws NotRequestException |
||
24 | */ |
||
25 | public function getRequest(): RequestInterface |
||
26 | { |
||
27 | if (empty($this['request'])) { |
||
28 | throw new NotRequestException; |
||
29 | } |
||
30 | return $this['request']; |
||
31 | } |
||
32 | |||
33 | /** |
||
34 | * Set PHP environment execution request. |
||
35 | * |
||
36 | * @param RequestInterface $request |
||
37 | */ |
||
38 | protected function setRequest(RequestInterface $request): void |
||
41 | } |
||
42 | } |
||
43 |