MessageEntry::text()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
crap 1
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: akeinhell
5
 * Date: 06.11.2016
6
 * Time: 11:46
7
 */
8
9
namespace Telegram\Entry;
10
11
12
use Telegram\Base\BaseEntry;
13
14
/**
15
 * Class MessageEntry
16
 * @package Telegram\Entry
17
 */
18
class MessageEntry extends BaseEntry
19
{
20
    /**
21
     * @param int $chatId
22
     * @return MessageEntry
23
     */
24 2
    public function to($chatId)
25
    {
26 2
        return $this->set('chat_id', $chatId);
27
    }
28
29
    public function withInlineKeyboard(InlineKeyboard $keyboard)
30
    {
31
        return $this->set('inline_keyboard', $keyboard->toArray());
32
    }
33
34 2
    public function text($text)
35
    {
36 2
        return $this->set('text', $text);
37
    }
38
39 1
    public function withReplyKeyboard(ReplyKeyboardEntry $keyboard)
40
    {
41 1
        return $this->set('reply_markup', $keyboard);
42
    }
43
44 1
    public function hideReplyKeyboard()
45
    {
46 1
        return $this->set('reply_markup', json_encode(['hide_keyboard' => true]));
47
    }
48
49
}