Passed
Push — master ( 96ab76...3ce77f )
by Nikolay
01:27 queued 10s
created

SetChatAdministratorCustomTitleMethod   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 9
dl 0
loc 21
c 1
b 0
f 0
ccs 6
cts 6
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A create() 0 8 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace TgBotApi\BotApiBase\Method;
6
7
use TgBotApi\BotApiBase\Method\Interfaces\SetMethodAliasInterface;
8
use TgBotApi\BotApiBase\Method\Traits\ChatIdVariableTrait;
9
use TgBotApi\BotApiBase\Method\Traits\UserIdVariableTrait;
10
11
/**
12
 * Use this method to set a custom title
13
 * for an administrator in a supergroup promoted by the bot. Returns True on success.
14
 *
15
 * @see https://core.telegram.org/bots/api#setchatadministratorcustomtitle
16
 */
17
class SetChatAdministratorCustomTitleMethod implements SetMethodAliasInterface
18
{
19
    use ChatIdVariableTrait;
20
    use UserIdVariableTrait;
21
22
    /**
23
     * @var string
24
     */
25
    public $customTitle;
26
27
    /**
28
     * @param int|string $chatId
29
     */
30 1
    public static function create($chatId, int $userId, string $title): SetChatAdministratorCustomTitleMethod
31
    {
32 1
        $instance = new static();
33 1
        $instance->chatId = $chatId;
34 1
        $instance->userId = $userId;
35 1
        $instance->customTitle = $title;
36
37 1
        return $instance;
38
    }
39
}
40