GetChatMemberMethod   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
eloc 7
dl 0
loc 18
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A create() 0 7 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace TgBotApi\BotApiBase\Method;
6
7
use TgBotApi\BotApiBase\Method\Interfaces\MethodInterface;
8
use TgBotApi\BotApiBase\Method\Traits\ChatIdVariableTrait;
9
use TgBotApi\BotApiBase\Method\Traits\UserIdVariableTrait;
10
11
/**
12
 * Class GetChatMemberMethod.
13
 *
14
 * @see https://core.telegram.org/bots/api#getchatmember
15
 */
16
class GetChatMemberMethod implements MethodInterface
17
{
18
    use ChatIdVariableTrait;
19
    use UserIdVariableTrait;
20
21
    /**
22
     * @param int|string $chatId
23
     * @param int        $userId
24
     *
25
     * @return GetChatMemberMethod
26
     */
27 2
    public static function create($chatId, int $userId): GetChatMemberMethod
28
    {
29 2
        $instance = new self();
30 2
        $instance->chatId = $chatId;
31 2
        $instance->userId = $userId;
32
33 2
        return $instance;
34
    }
35
}
36