Completed
Push — develop ( fbac2a...fa8907 )
by Edwin
04:58
created

Fulfillment::changeStatus()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 13
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 9
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 13
ccs 9
cts 9
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 9
nc 1
nop 3
crap 1
1
<?php
2
3
namespace ShopifyClient\Resource;
4
5
/**
6
 * https://help.shopify.com/api/reference/fulfillment
7
 *
8
 * @method create(array $parameters = [])
9
 * @method get(float $parentId, float $childId, array $parameters = [])
10
 * @method all(float $parentId, array $parameters = [])
11
 * @method count(float $parentId)
12
 * @method update(float $parentId,  float $childId, array $parameters = [])
13
 * @method complete(float $parentId, float $childId)
14
 * @method open(float $parentId, float $childId)
15
 * @method cancel(float $parentId, float $childId)
16
 *
17
 * @property FulfillmentEvent $events
18
 */
19
class Fulfillment extends AbstractResource implements Resource
20
{
21
    /**
22
     * @var array
23
     */
24
    protected $actions = [
25
        'create'   => [
26
            'method'      => 'POST',
27
            'endpoint'    => 'orders/%s/fulfillments.json',
28
            'resourceKey' => 'fulfillment',
29
            'responseKey' => 'fulfillment',
30
        ],
31
        'get'      => [
32
            'method'      => 'GET',
33
            'endpoint'    => 'orders/%s/fulfillments/%s.json',
34
            'resourceKey' => 'fulfillment',
35
            'responseKey' => 'fulfillment',
36
        ],
37
        'all'      => [
38
            'method'      => 'GET',
39
            'endpoint'    => 'orders/%s/fulfillments.json',
40
            'resourceKey' => 'fulfillments',
41
            'responseKey' => 'fulfillments',
42
        ],
43
        'count'    => [
44
            'method'      => 'GET',
45
            'endpoint'    => 'orders/%s/fulfillments/count.json',
46
            'resourceKey' => 'count',
47
            'responseKey' => 'count',
48
        ],
49
        'update'   => [
50
            'method'      => 'PUT',
51
            'endpoint'    => 'orders/%s/fulfillments/%s.json',
52
            'resourceKey' => 'fulfillment',
53
            'responseKey' => 'fulfillment',
54
        ],
55
        'complete' => [
56
            'method'      => 'POST',
57
            'endpoint'    => 'orders/%s/fulfillments/%s/complete.json',
58
            'resourceKey' => 'fulfillment',
59
            'responseKey' => 'fulfillment',
60
        ],
61
        'open'     => [
62
            'method'      => 'POST',
63
            'endpoint'    => 'orders/%s/fulfillments/%s/open.json',
64
            'resourceKey' => 'fulfillment',
65
            'responseKey' => 'fulfillment',
66
        ],
67
        'cancel'   => [
68
            'method'      => 'POST',
69
            'endpoint'    => 'orders/%s/fulfillments/%s/cancel.json',
70
            'resourceKey' => 'fulfillment',
71
            'responseKey' => 'fulfillment',
72
        ],
73
    ];
74
75
    protected $childResources = [
76
        'events' => FulfillmentEvent::class,
77
    ];
78
}
79