Completed
Push — master ( b6fc98...917978 )
by Irfaq
02:29
created

Button   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 1
c 1
b 0
f 1
lcom 1
cbo 2
dl 0
loc 16
ccs 0
cts 3
cp 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A setText() 0 6 1
1
<?php
2
namespace Telegram\Bot\Keyboard;
3
4
use Telegram\Bot\Helpers\Emojify;
5
6
/**
7
 * Class Button
8
 *
9
 * @method $this setRequestContact($boolean)    Optional. If True, the user's phone number will be sent as a contact when the button is pressed. Available in private chats only.
10
 * @method $this setRequestLocation($boolean)   Optional. If True, the user's current location will be sent when the button is pressed. Available in private chats only.
11
 *
12
 * @method $this setUrl($string)                (Inline Button Only) Optional. HTTP url to be opened when button is pressed.
13
 * @method $this setCallbackData($string)       (Inline Button Only) Optional. Data to be sent in a callback query to the bot when button is pressed.
14
 * @method $this setSwitchInlineQuery($string)  (Inline Button Only) Optional. If set, pressing the button will prompt the user to select one of their chats, open that chat and insert the bot‘s username and the specified inline query in the input field. Can be empty, in which case just the bot’s username will be inserted.
15
 */
16
class Button extends Base
17
{
18
    /**
19
     * Button Label Text
20
     *
21
     * @param string $text
22
     *
23
     * @return $this
24
     */
25
    public function setText($text)
26
    {
27
        $this->items['text'] = Emojify::text($text);
28
29
        return $this;
30
    }
31
}
32