ChatInviteLink   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 8
c 1
b 0
f 0
dl 0
loc 19
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A edit() 0 7 1
A revoke() 0 3 1
1
<?php
2
3
4
namespace Sysbot\Telegram\ExtendedTypes;
5
6
7
use GuzzleHttp\Promise\PromiseInterface;
8
9
trait ChatInviteLink
10
{
11
12
    use BaseType;
13
14
15
    public function edit(int|string $chatId, ?int $expireDate = null, ?int $memberLimit = null): PromiseInterface
16
    {
17
        return $this->api->editChatInviteLink(
18
            chatId: $chatId,
19
            inviteLink: $this->inviteLink,
20
            expireDate: $expireDate,
21
            memberLimit: $memberLimit
22
        );
23
    }
24
25
    public function revoke(int|string $chatId): PromiseInterface
26
    {
27
        return $this->api->revokeChatInviteLink(chatId: $chatId, inviteLink: $this->inviteLink);
28
    }
29
30
}