1 | <?php |
||
8 | class Conversations extends Provider |
||
9 | { |
||
10 | protected $loginRequired = ['last', 'sendMessage', 'sendEmail']; |
||
11 | |||
12 | /** |
||
13 | * Send message to a user |
||
14 | * |
||
15 | * @param array|int $userId |
||
16 | * @param string $text |
||
17 | * @param int|null $pinId |
||
18 | * @return bool |
||
19 | * |
||
20 | * @throws InvalidRequestException |
||
21 | */ |
||
22 | public function sendMessage($userId = [], $text, $pinId = null) |
||
28 | |||
29 | /** |
||
30 | * Send email |
||
31 | * |
||
32 | * @param array $emails |
||
33 | * @param string $text |
||
34 | * @param int|null $pinId |
||
35 | * @return bool |
||
36 | * @throws InvalidRequestException |
||
37 | */ |
||
38 | public function sendEmail($emails = [], $text, $pinId = null) |
||
44 | |||
45 | /** |
||
46 | * Get last user conversations |
||
47 | * |
||
48 | * @return array|bool |
||
49 | */ |
||
50 | public function last() |
||
58 | |||
59 | /** |
||
60 | * @param array $userId |
||
61 | * @param string $text |
||
62 | * @param int $pinId |
||
63 | * @param array $emails |
||
64 | * @return mixed |
||
65 | * |
||
66 | * @throws InvalidRequestException |
||
67 | */ |
||
68 | protected function callSendMessage($userId = [], $text, $pinId, $emails = []) |
||
83 | } |
||
84 |
If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:
If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.