Test Failed
Push — develop ( 1bc728...a00b17 )
by Edwin
03:32
created

OrderRisk::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 48
Code Lines 35

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 36
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 48
ccs 36
cts 36
cp 1
rs 9.125
c 0
b 0
f 0
cc 1
eloc 35
nc 1
nop 1
crap 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/order_risks
10
 *
11
 * @method create(float $parentId, array $parameters = [])
12
 * @method get(float $parentId, float $childId)
13
 * @method all(float $parentId)
14
 * @method update(float $parentId, float $childId, array $parameters = [])
15
 * @method delete(float $parentId, float $childId)
16
 *
17
 * @property $risks
18
 */
19
class OrderRisk extends AbstractResource implements Resource
20
{
21
    /**
22
     * OrderRisk constructor.
23
     * @param Request $request
24
     */
25 5
    public function __construct(Request $request)
26
    {
27 5
        parent::__construct($request);
28
29 5
        $this->actions->add(
30 5
            'create',
31 5
            new Action(
32 5
                Request::METHOD_POST,
33 5
                'orders/%s/risks.json',
34 5
                'risk',
35 5
                'risk'
36
            )
37
        );
38 5
        $this->actions->add(
39 5
            'get',
40 5
            new Action(
41 5
                Request::METHOD_GET,
42 5
                'orders/%s/risks/%s.json',
43 5
                'risk',
44 5
                'risk'
45
            )
46
        );
47 5
        $this->actions->add(
48 5
            'all',
49 5
            new Action(
50 5
                Request::METHOD_GET,
51 5
                'orders/%s/risks.json',
52 5
                'risks',
53 5
                'risks'
54
            )
55
        );
56 5
        $this->actions->add(
57 5
            'update',
58 5
            new Action(
59 5
                Request::METHOD_PUT,
60 5
                'orders/%s/risks/%s.json',
61 5
                'risk',
62 5
                'risk'
63
            )
64
        );
65 5
        $this->actions->add(
66 5
            'delete',
67 5
            new Action(
68 5
                Request::METHOD_DELETE,
69 5
                'orders/%s/risks/%s.json'
70
            )
71
        );
72 5
    }
73
}
74