Passed
Push — master ( 1b1236...bd5fab )
by Nikolay
01:00 queued 15s
created

BotCommandType::create()   A

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 1
Bugs 0 Features 1
Metric Value
eloc 4
c 1
b 0
f 1
dl 0
loc 7
ccs 5
cts 5
cp 1
rs 10
cc 1
nc 1
nop 2
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace TgBotApi\BotApiBase\Type;
6
7
/**
8
 * Class BotCommandType.
9
 *
10
 * This object represents a bot command.
11
 *
12
 * @see https://core.telegram.org/bots/api#botcommand
13
 */
14
class BotCommandType
15
{
16
    /**
17
     * Text of the command, 1-32 characters. Can contain only lowercase English letters, digits and underscores.
18
     *
19
     * @var string
20
     */
21
    public $command;
22
23
    /**
24
     * Description of the command, 3-256 characters.
25
     *
26
     * @var string
27
     */
28
    public $description;
29
30 1
    public static function create(string $command, string $description): BotCommandType
31
    {
32 1
        $instance = new static();
33 1
        $instance->command = $command;
34 1
        $instance->description = $description;
35
36 1
        return $instance;
37
    }
38
}
39