Completed
Push — master ( 7d37a2...fea370 )
by Nikolay
06:21
created

SetChatDescriptionMethod::__construct()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 5
ccs 0
cts 5
cp 0
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 2
crap 6
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Greenplugin\TelegramBot\Method;
6
7
use Greenplugin\TelegramBot\Method\Traits\ChatIdVariableTrait;
8
use Greenplugin\TelegramBot\Method\Traits\FillFromArrayTrait;
9
10
/**
11
 * Class SetChatDescriptionMethod.
12
 *
13
 * @see https://core.telegram.org/bots/api#setchatdescription
14
 */
15
class SetChatDescriptionMethod
16
{
17
    use FillFromArrayTrait;
18
    use ChatIdVariableTrait;
19
20
    /**
21
     * Optional. New chat description, 0-255 characters.
22
     *
23
     * @var string|null
24
     */
25
    public $description;
26
27
    /**
28
     * SetChatDescriptionMethod constructor.
29
     *
30
     * @param int|string $chatId
31
     * @param array|null $data
32
     *
33
     * @throws \Greenplugin\TelegramBot\Exception\BadArgumentException
34
     */
35
    public function __construct($chatId, array $data = null)
36
    {
37
        $this->chatId = $chatId;
38
        if ($data) {
39
            $this->fill($data);
40
        }
41
    }
42
}
43