GetChatMemberMethod::create()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 7
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
crap 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