1 | <?php |
||
14 | class ConversationManager implements Manager |
||
15 | { |
||
16 | private $intents = []; |
||
17 | private $fallbackIntent; |
||
18 | |||
19 | private $cache; |
||
20 | |||
21 | 68 | public function __construct(Repository $cache) |
|
25 | |||
26 | /** |
||
27 | * Register intent. |
||
28 | * |
||
29 | * @param string $class |
||
30 | */ |
||
31 | public function registerIntent(string $class): void |
||
35 | |||
36 | /** |
||
37 | * Register fallback intent. |
||
38 | * |
||
39 | * @param string $class |
||
40 | */ |
||
41 | 68 | public function registerFallbackIntent(string $class): void |
|
45 | |||
46 | /** |
||
47 | * Get all registered intents. |
||
48 | * |
||
49 | * @return array |
||
50 | */ |
||
51 | public function getIntents(): array |
||
55 | |||
56 | /** |
||
57 | * Match intent by received message. |
||
58 | * |
||
59 | * @param MessageReceived $messageReceived |
||
60 | * |
||
61 | * @return Intent|null |
||
62 | */ |
||
63 | public function matchIntent(MessageReceived $messageReceived): ?Intent |
||
79 | |||
80 | /** |
||
81 | * Resolve conversation context. |
||
82 | * |
||
83 | * @param Channel $channel |
||
84 | * @param Chat $chat |
||
85 | * @param User $user |
||
86 | * |
||
87 | * @return Context|null |
||
88 | */ |
||
89 | public function resolveContext(Channel $channel, Chat $chat, User $user): Context |
||
110 | |||
111 | /** |
||
112 | * Save context. |
||
113 | * |
||
114 | * @param Context $context |
||
115 | */ |
||
116 | public function saveContext(Context $context): void |
||
123 | |||
124 | private function getCacheKeyForContext(Channel $channel, Chat $chat, User $user): string |
||
128 | } |
||
129 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: