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

Message::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
use LeoCarmo\TelegramBot\Traits\SetReplyMarkupButton;
6
7
class Message extends Model
8
{
9
10
    use SetReplyMarkupButton;
11
12
    /**
13
     * https://core.telegram.org/bots/api#sendmessage
14
     * @var string
15
     */
16
    protected $method = 'sendMessage';
17
18
    /**
19
     * @var array
20
     */
21
    protected $required = [
22
        'chat_id', 'text'
23
    ];
24
25
    /**
26
     * @var string|integer
27
     */
28
    protected $chat_id;
29
30
    /**
31
     * @var string
32
     */
33
    protected $text;
34
35
    /**
36
     * @url https://core.telegram.org/bots/api#formatting-options
37
     * @var string
38
     */
39
    protected $parse_mode = 'markdown';
40
41
    /**
42
     * @var boolean
43
     */
44
    protected $disable_web_page_preview;
45
46
    /**
47
     * @var boolean
48
     */
49
    protected $disable_notification;
50
51
    /**
52
     * @var integer
53
     */
54
    protected $reply_to_message_id;
55
56
    /**
57
     * @var
58
     */
59
    protected $reply_markup;
60
61
    /**
62
     * Unique identifier for the target chat or username of the target channel
63
     * Required parameter
64
     *
65
     * @param string|integer $chat_id
66
     * @return $this
67
     */
68
    public function setChatId($chat_id)
69
    {
70
        $this->chat_id = $chat_id;
71
        return $this;
72
    }
73
74
    /**
75
     * Text of the message to be sent
76
     * Required parameter
77
     *
78
     * @param string $text
79
     * @return $this
80
     */
81
    public function setText(string $text)
82
    {
83
        $this->text = $text;
84
        return $this;
85
    }
86
87
}