DeleteWebhookMethod::create()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 9
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 1
crap 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace TgBotApi\BotApiBase\Method;
6
7
use TgBotApi\BotApiBase\Method\Interfaces\DeleteMethodAliasInterface;
8
use TgBotApi\BotApiBase\Method\Traits\FillFromArrayTrait;
9
10
/**
11
 * Class DeleteWebhookMethod.
12
 *
13
 * @see https://core.telegram.org/bots/api#deletewebhook
14
 */
15
class DeleteWebhookMethod implements DeleteMethodAliasInterface
16
{
17
    use FillFromArrayTrait;
18
19
    /**
20
     * Pass True to drop all pending updates.
21
     *
22
     * @var bool|null
23
     */
24
    public $dropPendingUpdates;
25
26
    /**
27
     * @throws \TgBotApi\BotApiBase\Exception\BadArgumentException
28
     */
29 1
    public static function create(array $data = null): DeleteWebhookMethod
30
    {
31 1
        $instance = new static();
32
33 1
        if ($data) {
34 1
            $instance->fill($data);
35
        }
36
37 1
        return $instance;
38
    }
39
}
40