ChatInviteLink::edit()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 7
rs 10
cc 1
nc 1
nop 3
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
}