Passed
Push — master ( 0efe7a...946c43 )
by Roberto
01:43
created

WebHook::update()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 4
c 0
b 0
f 0
rs 10
cc 1
nc 1
nop 1
1
<?php
2
/**
3
 * Copyright (c) 2019 - present
4
 * updown - Eventhp
5
 * author: Roberto Belotti - [email protected]
6
 * web : robertobelotti.com, github.com/biscolab
7
 * Initial version created on: 18/2/2019
8
 * MIT license: https://github.com/biscolab/updown-php/blob/master/LICENSE
9
 */
10
11
namespace Biscolab\UpDown\Objects;
12
13
use Biscolab\UpDown\Abstracts\AbstractObject;
14
use Biscolab\UpDown\Enum\UpDownFieldType;
15
use Biscolab\UpDown\Fields\WebHookFields;
16
use Biscolab\UpDown\Types\WebHooks;
17
18
/**
19
 * Event Node
20
 * @property string id
21
 * @property string url
22
 * @package Biscolab\UpDown\Object
23
 */
24
class WebHook extends CrudObject
25
{
26
27
    /**
28
     * @var string
29
     */
30
    protected static $endpoint = 'webhooks';
31
32
    /**
33
     * @var string
34
     */
35
    protected static $collection_type = WebHooks::class;
36
37
    /**
38
     * @var string
39
     */
40
    protected static $key = WebHookFields::ID;
41
42
    /**
43
     * @var array
44
     */
45
    protected $typeCheck = [
46
        WebHookFields::ID  => UpDownFieldType::STRING,
47
        WebHookFields::URL => UpDownFieldType::STRING,
48
    ];
49
50
    /**
51
     * @return AbstractObject
52
     * @throws \Exception
53
     */
54
    public function read(): AbstractObject
55
    {
56
57
        throw new \Exception(__CLASS__ . ' doesn not have ' . __METHOD__ . ' method');
58
    }
59
60
    /**
61
     * @param array|null $params
62
     *
63
     * @return AbstractObject
64
     * @throws \Exception
65
     */
66
    public function update(?array $params = []): AbstractObject
67
    {
68
69
        throw new \Exception(__CLASS__ . ' doesn not have ' . __METHOD__ . ' method');
70
    }
71
72
}