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

FulfillmentEvent::__construct()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 40
Code Lines 28

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 29
CRAP Score 1

Importance

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