BaseChat   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 12
c 1
b 0
f 0
dl 0
loc 25
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A sendMessage() 0 20 1
1
<?php
2
3
4
namespace Sysbot\Telegram\ExtendedTypes;
5
6
7
use GuzzleHttp\Promise\PromiseInterface;
8
use Sysbot\Telegram\Types\ForceReply;
9
use Sysbot\Telegram\Types\InlineKeyboardMarkup;
10
use Sysbot\Telegram\Types\ReplyKeyboardMarkup;
11
use Sysbot\Telegram\Types\ReplyKeyboardRemove;
12
13
trait BaseChat
14
{
15
16
    use BaseType;
17
18
    public function sendMessage(
19
        string $text,
20
        ?string $parseMode = null,
21
        ?array $entities = null,
22
        ?bool $disableWebPagePreview = null,
23
        ?bool $disableNotification = null,
24
        ?int $replyToMessageId = null,
25
        ?bool $allowSendingWithoutReply = null,
26
        InlineKeyboardMarkup|ReplyKeyboardMarkup|ReplyKeyboardRemove|ForceReply|null $replyMarkup = null
27
    ): PromiseInterface {
28
        return $this->api->sendMessage(
29
            chatId: $this->id,
30
            text: $text,
31
            parseMode: $parseMode,
32
            entities: $entities,
33
            disableWebPagePreview: $disableWebPagePreview,
34
            disableNotification: $disableNotification,
35
            replyToMessageId: $replyToMessageId,
36
            allowSendingWithoutReply: $allowSendingWithoutReply,
37
            replyMarkup: $replyMarkup
38
        );
39
    }
40
41
}