1 | <?php |
||
19 | class Kernel |
||
20 | { |
||
21 | /** @var Kernel */ |
||
22 | protected static $instance; |
||
23 | |||
24 | private $container; |
||
25 | private $channel; |
||
26 | private $driver; |
||
27 | |||
28 | /** @var Context|null */ |
||
29 | private $context; |
||
30 | |||
31 | 7 | protected function __construct( |
|
40 | |||
41 | /** |
||
42 | * Create new kernel instance. |
||
43 | * |
||
44 | * @param Container $container |
||
45 | * @param Channel $channel |
||
46 | * @param Driver $driver |
||
47 | */ |
||
48 | 7 | public static function createInstance( |
|
57 | |||
58 | /** |
||
59 | * Get current instance. |
||
60 | * |
||
61 | * @return Kernel |
||
62 | */ |
||
63 | 7 | public static function getInstance(): Kernel |
|
67 | |||
68 | /** |
||
69 | * Set kernel instance. |
||
70 | * |
||
71 | * @param Kernel $instance |
||
72 | */ |
||
73 | 93 | public static function setInstance(Kernel $instance): void |
|
77 | |||
78 | /** |
||
79 | * Get current driver instance. |
||
80 | * |
||
81 | * @return Driver |
||
82 | */ |
||
83 | 1 | public function getDriver(): Driver |
|
87 | |||
88 | /** |
||
89 | * Get context instance. |
||
90 | * |
||
91 | * @return Context|null |
||
92 | */ |
||
93 | 2 | public function getContext(): ?Context |
|
97 | |||
98 | /** |
||
99 | * Set context instance. |
||
100 | * |
||
101 | * @param Context $context |
||
102 | */ |
||
103 | 2 | public function setContext(Context $context): void |
|
107 | |||
108 | /** |
||
109 | * Clear context. |
||
110 | */ |
||
111 | 1 | public function clearContext(): void |
|
118 | |||
119 | /** |
||
120 | * Resolve from container. |
||
121 | * |
||
122 | * @param string $class |
||
123 | * |
||
124 | * @return mixed |
||
125 | */ |
||
126 | 3 | public function resolve(string $class) |
|
130 | |||
131 | /** |
||
132 | * Process webhook request. |
||
133 | * |
||
134 | * @return mixed |
||
135 | */ |
||
136 | 4 | public function process() |
|
169 | |||
170 | /** |
||
171 | * Start conversation. |
||
172 | * |
||
173 | * @param Conversable $conversable |
||
174 | */ |
||
175 | 2 | public function converse(Conversable $conversable): void |
|
187 | |||
188 | /** |
||
189 | * Get context manager. |
||
190 | * |
||
191 | * @return ContextManager |
||
192 | */ |
||
193 | 3 | private function contextManager(): ContextManager |
|
197 | |||
198 | /** |
||
199 | * Get intent manager. |
||
200 | * |
||
201 | * @return IntentManager |
||
202 | */ |
||
203 | 1 | private function intentManager(): IntentManager |
|
207 | } |
||
208 |