1 | <?php |
||
18 | class Kernel |
||
19 | { |
||
20 | /** @var Kernel */ |
||
21 | protected static $instance; |
||
22 | |||
23 | private $container; |
||
24 | |||
25 | /** @var Context|null */ |
||
26 | private $context; |
||
27 | |||
28 | 6 | public function __construct(Container $container) |
|
32 | |||
33 | /** |
||
34 | * Get current driver instance. |
||
35 | * |
||
36 | * @return Driver |
||
37 | */ |
||
38 | 1 | public function getDriver(): Driver |
|
42 | |||
43 | /** |
||
44 | * Get context instance. |
||
45 | * |
||
46 | * @return Context|null |
||
47 | */ |
||
48 | 2 | public function getContext(): ?Context |
|
52 | |||
53 | /** |
||
54 | * Set context instance. |
||
55 | * |
||
56 | * @param Context $context |
||
57 | */ |
||
58 | 2 | public function setContext(Context $context): void |
|
62 | |||
63 | /** |
||
64 | * Clear context. |
||
65 | */ |
||
66 | 1 | public function clearContext(): void |
|
73 | |||
74 | /** |
||
75 | * Resolve from container. |
||
76 | * |
||
77 | * @param string $class |
||
78 | * |
||
79 | * @return mixed |
||
80 | */ |
||
81 | 3 | public function resolve(string $class) |
|
85 | |||
86 | /** |
||
87 | * Process webhook request. |
||
88 | * |
||
89 | * @param Driver $driver |
||
90 | * @param Channel $channel |
||
91 | * |
||
92 | * @param array $request |
||
93 | * @param array $headers |
||
94 | * |
||
95 | * @return mixed |
||
96 | */ |
||
97 | 4 | public function process(Driver $driver, Channel $channel, array $request, array $headers) |
|
134 | |||
135 | /** |
||
136 | * Start conversation. |
||
137 | * |
||
138 | * @param Conversable $conversable |
||
139 | */ |
||
140 | 2 | public function converse(Conversable $conversable): void |
|
152 | |||
153 | /** |
||
154 | * Get context manager. |
||
155 | * |
||
156 | * @return ContextManager |
||
157 | */ |
||
158 | 3 | private function contextManager(): ContextManager |
|
162 | |||
163 | /** |
||
164 | * Get intent manager. |
||
165 | * |
||
166 | * @return IntentManager |
||
167 | */ |
||
168 | 1 | private function intentManager(): IntentManager |
|
172 | } |
||
173 |