Total Complexity | 3 |
Total Lines | 50 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
19 | class Text extends Message |
||
20 | { |
||
21 | /** |
||
22 | * @var string |
||
23 | */ |
||
24 | protected $type = 'text'; |
||
25 | |||
26 | /** |
||
27 | * @var array |
||
28 | */ |
||
29 | protected $properties = ['content', 'mentioned_list', 'mentioned_mobile_list']; |
||
30 | |||
31 | /** |
||
32 | * Text constructor. |
||
33 | * |
||
34 | * @param string $content |
||
35 | * @param string|array $userIds |
||
36 | * @param string|array $mobiles |
||
37 | */ |
||
38 | 8 | public function __construct(string $content, $userIds = [], $mobiles = []) |
|
39 | { |
||
40 | 8 | parent::__construct([ |
|
41 | 8 | 'content' => $content, |
|
42 | 8 | 'mentioned_list' => (array)$userIds, |
|
43 | 8 | 'mentioned_mobile_list' => (array)$mobiles, |
|
44 | ]); |
||
45 | 8 | } |
|
46 | |||
47 | /** |
||
48 | * @param $userIds |
||
49 | * |
||
50 | * @return Text |
||
51 | */ |
||
52 | 2 | public function mention($userIds) |
|
53 | { |
||
54 | 2 | $this->set('mentioned_list', (array)$userIds); |
|
55 | |||
56 | 2 | return $this; |
|
57 | } |
||
58 | |||
59 | /** |
||
60 | * @param $mobiles |
||
61 | * |
||
62 | * @return Text |
||
63 | */ |
||
64 | 2 | public function mentionByMobile($mobiles) |
|
69 | } |
||
70 | } |
||
71 |