Passed
Pull Request — master (#221)
by
unknown
02:36
created

ChatPermissions::setCanSendPolls()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 2
1
<?php
2
3
namespace TelegramBot\Api\Types;
4
5
use TelegramBot\Api\BaseType;
6
7
class ChatPermissions extends BaseType
8
{
9
10
    /**
11
     * {@inheritdoc}
12
     *
13
     * @var array
14
     */
15
    static protected $map = [
16
        'can_send_messages' => true,
17
        'can_send_media_messages' => true,
18
        'can_send_polls' => true,
19
        'can_send_other_messages' => true,
20
        'can_add_web_page_previews' => true,
21
        'can_change_info' => true,
22
        'can_invite_users' => true,
23
        'can_pin_messages' => true
24
    ];
25
26
    /**
27
     * Optional. True, if the user is allowed to send text messages, contacts, locations and venues
28
     *
29
     * @var bool
30
     */
31
    protected $canSendMessages;
32
    
33
    /**
34
     * Optional. True, if the user is allowed to send audios, documents, photos, videos, video notes and voice notes, implies can_send_messages
35
     *
36
     * @var bool
37
     */
38
    protected $canSendMediaMessages;
39
40
    /**
41
     * Optional. True, if the user is allowed to send polls, implies can_send_messages
42
     *
43
     * @var bool
44
     */
45
    protected $canSendPolls;
46
47
    /**
48
     * Optional. True, if the user is allowed to send animations, games, stickers and use inline bots, implies can_send_media_messages
49
     *
50
     * @var bool
51
     */
52
    protected $canSendOtherMessages;
53
54
    /**
55
     * Optional. True, if the user is allowed to add web page previews to their messages, implies can_send_media_messages
56
     *
57
     * @var bool
58
     */
59
    protected $canAddWebPagePreviews;
60
61
    /**
62
     * Optional. True, if the user is allowed to change the chat title, photo and other settings. Ignored in public supergroups
63
     *
64
     * @var bool
65
     */
66
    protected $canChangeInfo;
67
68
    /**
69
     * Optional. True, if the user is allowed to invite new users to the chat
70
     *
71
     * @var bool
72
     */
73
    protected $canInviteUsers;
74
75
    /**
76
     * Optional. True, if the user is allowed to pin messages. Ignored in public supergroups
77
     *
78
     * @var bool
79
     */
80
    protected $canPinMessages;
81
82
    /**
83
     * @param bool $canSendMessages
84
     */
85
    public function setCanSendMessages($canSendMessages)
86
    {
87
        $this->canSendMessages = $canSendMessages;
88
    }
89
90
    /**
91
     * @param bool $canSendMediaMessages
92
     */
93
    public function setCanSendMediaMessages($canSendMediaMessages)
94
    {
95
        $this->canSendMediaMessages = $canSendMediaMessages;
96
    }
97
98
    /**
99
     * @param bool $canSendPolls
100
     */
101
    public function setCanSendPolls($canSendPolls)
102
    {
103
        $this->canSendPolls = $canSendPolls;
104
    }
105
106
    /**
107
     * @param bool $canSendOtherMessages
108
     */
109
    public function setCanSendOtherMessages($canSendOtherMessages)
110
    {
111
        $this->canSendOtherMessages = $canSendOtherMessages;
112
    }
113
114
    /**
115
     * @param bool $canAddWebPagePreviews
116
     */
117
    public function setCanAddWebPagePreviews($canAddWebPagePreviews)
118
    {
119
        $this->canAddWebPagePreviews = $canAddWebPagePreviews;
120
    }
121
122
    /**
123
     * @param bool $canChangeInfo
124
     */
125
    public function setCanChangeInfo($canChangeInfo)
126
    {
127
        $this->canChangeInfo = $canChangeInfo;
128
    }
129
130
    /**
131
     * @param bool $canInviteUsers
132
     */
133
    public function setCanInviteUsers($canInviteUsers)
134
    {
135
        $this->canInviteUsers = $canInviteUsers;
136
    }
137
138
    /**
139
     * @param bool $canPinMessages
140
     */
141
    public function setCanPinMessages($canPinMessages)
142
    {
143
        $this->canPinMessages = $canPinMessages;
144
    }
145
146
    /**
147
     * @return bool
148
     */
149
    public function getCanSendMessages()
150
    {
151
        return $this->canSendMessages;
152
    }
153
154
    /**
155
     * @return bool
156
     */
157
    public function getCanSendMediaMessages()
158
    {
159
        return $this->canSendMediaMessages;
160
    }
161
162
    /**
163
     * @return bool
164
     */
165
    public function getCanSendPolls()
166
    {
167
        return $this->canSendPolls;
168
    }
169
170
    /**
171
     * @return bool
172
     */
173
    public function getCanSendOtherMessages()
174
    {
175
        return $this->canSendOtherMessages;
176
    }
177
178
    /**
179
     * @return bool
180
     */
181
    public function getCanAddWebPagePreviews()
182
    {
183
        return $this->canAddWebPagePreviews;
184
    }
185
186
    /**
187
     * @return bool
188
     */
189
    public function getCanChangeInfo()
190
    {
191
        return $this->canChangeInfo;
192
    }
193
194
    /**
195
     * @return bool
196
     */
197
    public function getCanInviteUsers()
198
    {
199
        return $this->canInviteUsers;
200
    }
201
202
    /**
203
     * @return bool
204
     */
205
    public function getCanPinMessages()
206
    {
207
        return $this->canPinMessages;
208
    }
209
}