1 | <?php |
||
10 | class ConversationManager implements Manager |
||
11 | { |
||
12 | private $intents = []; |
||
13 | private $fallbackIntent; |
||
14 | |||
15 | /** |
||
16 | * Register intent. |
||
17 | * |
||
18 | * @param string $class |
||
19 | */ |
||
20 | public function registerIntent(string $class): void |
||
24 | |||
25 | /** |
||
26 | * Register fallback intent. |
||
27 | * |
||
28 | * @param string $class |
||
29 | */ |
||
30 | 83 | public function registerFallbackIntent(string $class): void |
|
31 | { |
||
32 | 83 | $this->fallbackIntent = $class; |
|
33 | 83 | } |
|
34 | |||
35 | /** |
||
36 | * Get all registered intents. |
||
37 | * |
||
38 | * @return array |
||
39 | */ |
||
40 | public function getIntents(): array |
||
44 | |||
45 | /** |
||
46 | * Match intent by received message. |
||
47 | * |
||
48 | * @param MessageReceived $messageReceived |
||
49 | * |
||
50 | * @return Intent|null |
||
51 | */ |
||
52 | public function matchIntent(MessageReceived $messageReceived): ?Intent |
||
68 | } |
||
69 |
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: