| 1 | <?php |
||
| 12 | class Context implements Arrayable |
||
| 13 | { |
||
| 14 | private $channel; |
||
| 15 | private $chat; |
||
| 16 | private $user; |
||
| 17 | private $items; |
||
| 18 | |||
| 19 | 3 | public function __construct(Channel $channel, Chat $chat, User $user, array $items = []) |
|
| 26 | |||
| 27 | /** |
||
| 28 | * Get channel. |
||
| 29 | * |
||
| 30 | * @return Channel |
||
| 31 | */ |
||
| 32 | 1 | public function getChannel(): Channel |
|
| 36 | |||
| 37 | /** |
||
| 38 | * Get chat. |
||
| 39 | * |
||
| 40 | * @return Chat |
||
| 41 | */ |
||
| 42 | 1 | public function getChat(): Chat |
|
| 46 | |||
| 47 | /** |
||
| 48 | * Get user. |
||
| 49 | * |
||
| 50 | * @return User |
||
| 51 | */ |
||
| 52 | 1 | public function getUser(): User |
|
| 56 | |||
| 57 | /** |
||
| 58 | * Get item. |
||
| 59 | * |
||
| 60 | * @param string $key |
||
| 61 | * @param null $default |
||
| 62 | * |
||
| 63 | * @return mixed |
||
| 64 | */ |
||
| 65 | 3 | public function get(string $key, $default = null) |
|
| 69 | |||
| 70 | /** |
||
| 71 | * Set item. |
||
| 72 | * |
||
| 73 | * @param string $key |
||
| 74 | * @param mixed $value |
||
| 75 | */ |
||
| 76 | 2 | public function set(string $key, $value): void |
|
| 80 | |||
| 81 | /** |
||
| 82 | * Get the instance as an array. |
||
| 83 | * |
||
| 84 | * @return array |
||
| 85 | */ |
||
| 86 | 1 | public function toArray(): array |
|
| 90 | } |
||
| 91 |