1 | <?php |
||
12 | trait InteractsWithContext |
||
13 | { |
||
14 | 1 | protected function getChannel(): Channel |
|
18 | |||
19 | /** |
||
20 | * Get chat. |
||
21 | * |
||
22 | * @return Chat |
||
23 | */ |
||
24 | 1 | protected function getChat(): Chat |
|
28 | |||
29 | /** |
||
30 | * Get user. |
||
31 | * |
||
32 | * @return User |
||
33 | */ |
||
34 | 1 | protected function getUser(): User |
|
38 | |||
39 | /** |
||
40 | * Get the whole context or a single value. |
||
41 | * |
||
42 | * @param string|null $key |
||
43 | * @param mixed $default |
||
44 | * |
||
45 | * @return Context|mixed |
||
46 | */ |
||
47 | 5 | protected function context(string $key = null, $default = null) |
|
51 | |||
52 | /** |
||
53 | * Remember value in context. |
||
54 | * |
||
55 | * @param string $key |
||
56 | * @param mixed $value |
||
57 | */ |
||
58 | 1 | protected function remember(string $key, $value): void |
|
62 | } |
||
63 |