Passed
Branch master (58629d)
by Leonardo
01:27
created

ChatAction::setChatId()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace LeoCarmo\TelegramBot\Model;
4
5
class ChatAction extends Model
6
{
7
8
    /**
9
     * https://core.telegram.org/bots/api#sendchataction
10
     * @var string
11
     */
12
    protected $method = 'sendChatAction';
13
14
    /**
15
     * @var array
16
     */
17
    protected $required = [
18
        'chat_id', 'action'
19
    ];
20
21
    /**
22
     * @var string|integer
23
     */
24
    protected $chat_id;
25
26
    /**
27
     * @var string
28
     */
29
    protected $action;
30
31
    /**
32
     * Unique identifier for the target chat or username of the target channel
33
     * Required parameter
34
     *
35
     * @param string|integer $chat_id
36
     * @return $this
37
     */
38
    public function setChatId($chat_id)
39
    {
40
        $this->chat_id = $chat_id;
41
        return $this;
42
    }
43
44
    /**
45
     * Unique identifier for the target chat or username of the target channel
46
     * Required parameter
47
     *
48
     * Type of action to broadcast. Choose one, depending on what the user is about to receive:
49
     * typing for text messages
50
     * upload_photo for photos
51
     * record_video or upload_video for videos
52
     * record_audio or upload_audio for audio files
53
     * upload_document for general files
54
     * find_location for location data
55
     * record_video_note or upload_video_note for video notes
56
     *
57
     * @param string $action
58
     * @return $this
59
     */
60
    public function setAction(string $action)
61
    {
62
        $this->action = $action;
63
        return $this;
64
    }
65
66
}