Completed
Pull Request — master (#28)
by Nikolay
11:57
created

BotCommandType   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

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\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 3
    public static function create(string $command, string $description): BotCommandType
31
    {
32 3
        $instance = new static();
33 3
        $instance->command = $command;
34 3
        $instance->description = $description;
35
36 3
        return $instance;
37
    }
38
}
39