Webhook   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 60
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 3
dl 0
loc 60
ccs 43
cts 43
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 57 1
1
<?php
2
3
namespace ShopifyClient\Resource;
4
5
use ShopifyClient\Action\Action;
6
use ShopifyClient\Request;
7
8
/**
9
 * https://help.shopify.com/api/reference/webhook
10
 *
11
 * @method create(array $parameters = [])
12
 * @method get(float $parentId)
13
 * @method all(float $parentId)
14
 * @method update(float $parentId, array $parameters = [])
15
 * @method delete(float $parentId)
16
 */
17
class Webhook extends AbstractResource implements Resource
18
{
19 5
    public function __construct(Request $request)
20
    {
21 5
        parent::__construct($request);
22
23 5
        $this->actions->add(
24 5
            'create',
25 5
            new Action(
26 5
                Request::METHOD_POST,
27 5
                'webhooks.json',
28 5
                'webhook',
29 5
                'webhook'
30
            )
31
        );
32 5
        $this->actions->add(
33 5
            'get',
34 5
            new Action(
35 5
                Request::METHOD_GET,
36 5
                'webhooks/%s.json',
37 5
                'webhook',
38 5
                'webhook'
39
            )
40
        );
41 5
        $this->actions->add(
42 5
            'all',
43 5
            new Action(
44 5
                Request::METHOD_GET,
45 5
                'webhooks.json',
46 5
                'webhooks',
47 5
                'webhooks'
48
            )
49
        );
50 5
        $this->actions->add(
51 5
            'count',
52 5
            new Action(
53 5
                Request::METHOD_GET,
54 5
                'webhooks/count.json',
55 5
                'count',
56 5
                'count'
57
            )
58
        );
59 5
        $this->actions->add(
60 5
            'update',
61 5
            new Action(
62 5
                Request::METHOD_PUT,
63 5
                'webhooks/%s.json',
64 5
                'webhook',
65 5
                'webhook'
66
            )
67
        );
68 5
        $this->actions->add(
69 5
            'delete',
70 5
            new Action(
71 5
                Request::METHOD_DELETE,
72 5
                'webhooks/%s.json'
73
            )
74
        );
75 5
    }
76
}
77