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

Photo::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 Photo extends Model
8
{
9
10
    use SetReplyMarkupButton;
11
12
    /**
13
     * @url https://core.telegram.org/bots/api#sendphoto
14
     * @var string
15
     */
16
    protected $method = 'sendPhoto';
17
18
    /**
19
     * @var array
20
     */
21
    protected $required = [
22
        'chat_id', 'photo'
23
    ];
24
25
    /**
26
     * @var string|integer
27
     */
28
    protected $chat_id;
29
30
    /**
31
     * @var string
32
     */
33
    protected $photo;
34
35
    /**
36
     * @var string
37
     */
38
    protected $caption;
39
40
    /**
41
     * @var string
42
     */
43
    protected $parse_mode;
44
45
    /**
46
     * @var boolean
47
     */
48
    protected $disable_notification;
49
50
    /**
51
     * @var integer
52
     */
53
    protected $reply_to_message_id;
54
55
    /**
56
     * @var
57
     */
58
    protected $reply_markup;
59
60
    /**
61
     * Unique identifier for the target chat or username of the target channel
62
     * Required parameter
63
     *
64
     * @param string|integer $chat_id
65
     * @return $this
66
     */
67
    public function setChatId($chat_id)
68
    {
69
        $this->chat_id = $chat_id;
70
        return $this;
71
    }
72
73
    /**
74
     * Photo to send. Pass a file_id as String to send a photo that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a photo from the Internet.
75
     *
76
     * @param $photo
77
     * @return $this
78
     */
79
    public function setPhoto($photo)
80
    {
81
        $this->photo = $photo;
82
        return $this;
83
    }
84
85
}