Completed
Push — draft ( ea8647...8ec7b9 )
by Nikolay
02:56
created

SendGameMethod   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
eloc 11
dl 0
loc 48
ccs 0
cts 6
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Greenplugin\TelegramBot\Method;
6
7
use Greenplugin\TelegramBot\Method\Traits\FillFromArrayTrait;
8
use Greenplugin\TelegramBot\Method\Traits\ReplyMarkupVariableTrait;
9
10
/**
11
 * Class SendGameType.
12
 *
13
 * @see https://core.telegram.org/bots/api#sendgame
14
 */
15
class SendGameMethod
16
{
17
    use FillFromArrayTrait;
18
    use ReplyMarkupVariableTrait;
19
20
    /**
21
     * Unique identifier for the target chat.
22
     *
23
     * @var int
24
     */
25
    public $chatId;
26
27
    /**
28
     * Short name of the game, serves as the unique identifier for the game. Set up your games via Botfather.
29
     *
30
     * @var string
31
     */
32
    public $gameShortName;
33
34
    /**
35
     * Sends the message silently. Users will receive a notification with no sound.
36
     *
37
     * @var bool|null
38
     */
39
    public $disableNotification;
40
41
    /**
42
     * If the message is a reply, ID of the original message.
43
     *
44
     * @var int|null
45
     */
46
    public $replyToMessageId;
47
48
    /**
49
     * SendGameType constructor.
50
     *
51
     * @param int        $chatId
52
     * @param string     $gameShortName
53
     * @param array|null $data
54
     *
55
     * @throws \Greenplugin\TelegramBot\Exception\BadArgumentException
56
     */
57
    public function __construct(int $chatId, string $gameShortName, array $data = null)
58
    {
59
        $this->chatId = $chatId;
60
        $this->gameShortName = $gameShortName;
61
        if ($data) {
62
            $this->fill($data);
63
        }
64
    }
65
}
66