1 | <?php |
||
19 | class Kernel |
||
20 | { |
||
21 | /** @var Kernel */ |
||
22 | protected static $instance; |
||
23 | |||
24 | private $container; |
||
25 | |||
26 | /** @var Context|null */ |
||
27 | private $context; |
||
28 | |||
29 | 6 | public function __construct(Container $container) |
|
33 | |||
34 | /** |
||
35 | * Get current driver instance. |
||
36 | * |
||
37 | * @return Driver |
||
38 | */ |
||
39 | 1 | public function getDriver(): Driver |
|
43 | |||
44 | /** |
||
45 | * Get context instance. |
||
46 | * |
||
47 | * @return Context|null |
||
48 | */ |
||
49 | 2 | public function getContext(): ?Context |
|
53 | |||
54 | /** |
||
55 | * Set context instance. |
||
56 | * |
||
57 | * @param Context $context |
||
58 | */ |
||
59 | 2 | public function setContext(Context $context): void |
|
63 | |||
64 | /** |
||
65 | * Clear context. |
||
66 | */ |
||
67 | 1 | public function clearContext(): void |
|
74 | |||
75 | /** |
||
76 | * Resolve from container. |
||
77 | * |
||
78 | * @param string $class |
||
79 | * |
||
80 | * @return mixed |
||
81 | */ |
||
82 | 5 | public function resolve(string $class) |
|
86 | |||
87 | /** |
||
88 | * Process webhook request. |
||
89 | * |
||
90 | * @param Channel $channel |
||
91 | * |
||
92 | * @param array $request |
||
93 | * @param array $headers |
||
94 | * |
||
95 | * @return mixed |
||
96 | */ |
||
97 | 4 | public function process(Channel $channel, array $request, array $headers) |
|
136 | |||
137 | /** |
||
138 | * Start conversation. |
||
139 | * |
||
140 | * @param Conversable $conversable |
||
141 | */ |
||
142 | 2 | public function converse(Conversable $conversable): void |
|
154 | |||
155 | /** |
||
156 | * Get driver manager. |
||
157 | * |
||
158 | * @return DriverManager |
||
159 | */ |
||
160 | 4 | private function driverManager(): DriverManager |
|
164 | |||
165 | /** |
||
166 | * Get context manager. |
||
167 | * |
||
168 | * @return ContextManager |
||
169 | */ |
||
170 | 3 | private function contextManager(): ContextManager |
|
174 | |||
175 | /** |
||
176 | * Get intent manager. |
||
177 | * |
||
178 | * @return IntentManager |
||
179 | */ |
||
180 | 1 | private function intentManager(): IntentManager |
|
184 | } |
||
185 |