WebHook::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
c 1
b 0
f 0
dl 0
loc 6
ccs 0
cts 5
cp 0
rs 10
cc 1
nc 1
nop 1
crap 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace CdekSDK2\BaseTypes;
6
7
use JMS\Serializer\Annotation\Type;
8
9
/**
10
 * Class WebHook
11
 * @package CdekSDK2\BaseTypes
12
 */
13
class WebHook extends Base
14
{
15
    /**
16
     * Идентификатор подписки
17
     * @Type("string")
18
     * @var string
19
     */
20
    public $uuid;
21
22
    /**
23
     * Тип события
24
     * @Type("string")
25
     * @var string
26
     */
27
    public $type;
28
29
    /**
30
     * URL клиента для получения вебхуков
31
     * @Type("string")
32
     * @var string
33
     */
34
    public $url;
35
36
    /**
37
     * WebHook constructor.
38
     * @param array $param
39
     */
40
    public function __construct(array $param = [])
41
    {
42
        parent::__construct($param);
43
        $this->rules = [
44
            'type' => 'required|alpha_dash',
45
            'url' => 'required|url',
46
        ];
47
    }
48
}
49