| 1 | <?php |
||
| 12 | trait InteractsWithSession |
||
| 13 | { |
||
| 14 | /** @var Kernel */ |
||
| 15 | protected $kernel; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * Get the whole context or a single value. |
||
| 19 | * |
||
| 20 | * @param string|null $key |
||
| 21 | * |
||
| 22 | * @return array|mixed |
||
| 23 | */ |
||
| 24 | 1 | protected function context(string $key = null) |
|
| 33 | |||
| 34 | /** |
||
| 35 | * Remember value in context. |
||
| 36 | * |
||
| 37 | * @param string $key |
||
| 38 | * @param $value |
||
| 39 | */ |
||
| 40 | 2 | protected function remember(string $key, $value): void |
|
| 44 | |||
| 45 | /** |
||
| 46 | * Get chat. |
||
| 47 | * |
||
| 48 | * @return Chat |
||
| 49 | */ |
||
| 50 | 1 | protected function getChat(): Chat |
|
| 54 | |||
| 55 | /** |
||
| 56 | * Get user. |
||
| 57 | * |
||
| 58 | * @return User |
||
| 59 | */ |
||
| 60 | 2 | protected function getUser(): User |
|
| 64 | } |
||
| 65 |