InlineQueryResultGameType   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
eloc 8
dl 0
loc 27
ccs 0
cts 7
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Greenplugin\TelegramBot\Type\InlineQueryResult;
6
7
use Greenplugin\TelegramBot\Method\Traits\FillFromArrayTrait;
8
9
/**
10
 * Class InlineQueryResultGameType.
11
 *
12
 * @see https://core.telegram.org/bots/api#inlinequeryresultgame
13
 */
14
class InlineQueryResultGameType extends InlineQueryResultType
15
{
16
    use FillFromArrayTrait;
17
18
    /**
19
     * Short name of the game.
20
     *
21
     * @var string
22
     */
23
    public $gameShortName;
24
25
    /**
26
     * InlineQueryResultGameType constructor.
27
     *
28
     * @param string     $id
29
     * @param string     $gameShortName
30
     * @param array|null $data
31
     *
32
     * @throws \Greenplugin\TelegramBot\Exception\BadArgumentException
33
     */
34
    public function __construct(string $id, string $gameShortName, array $data = null)
35
    {
36
        $this->type = self::TYPE_GAME;
37
        $this->id = $id;
38
        $this->gameShortName = $gameShortName;
39
        if ($data) {
40
            $this->fill($data);
41
        }
42
    }
43
}
44