1 | <?php |
||
12 | class Context implements Arrayable |
||
13 | { |
||
14 | private $channel; |
||
15 | private $chat; |
||
16 | private $user; |
||
17 | private $intent; |
||
18 | private $interaction; |
||
19 | private $items; |
||
20 | private $attempts = 0; |
||
21 | |||
22 | 9 | public function __construct(Channel $channel, Chat $chat, User $user, array $items = []) |
|
29 | |||
30 | 4 | public function getChannel(): Channel |
|
34 | |||
35 | 4 | public function getChat(): Chat |
|
39 | |||
40 | 4 | public function getUser(): User |
|
44 | |||
45 | 2 | public function getIntent(): ?Intent |
|
49 | |||
50 | 2 | public function setIntent(Intent $intent): Context |
|
56 | |||
57 | 2 | public function getInteraction(): ?Interaction |
|
61 | |||
62 | 2 | public function setInteraction(?Interaction $interaction): Context |
|
68 | |||
69 | 5 | public function getItem(string $key, $default = null) |
|
73 | |||
74 | 3 | public function setItem(string $key, $value): Context |
|
80 | |||
81 | public function incrementAttempts(): Context |
||
87 | |||
88 | public function attempts(): int |
||
92 | |||
93 | 2 | public function toArray(): array |
|
102 | } |
||
103 |