Passed
Push — develop ( 0f04a2...a9858e )
by Edwin
03:49
created

FulfillmentEvent::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 9
ccs 7
cts 7
cp 1
rs 9.6666
c 0
b 0
f 0
cc 1
eloc 6
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('create', new Action(Request::METHOD_POST, 'orders/%s/fulfillments/%s/events.json', 'fulfillment_event', 'event'));
27 5
        $this->actions->add('get', new Action(Request::METHOD_GET, 'orders/%s/fulfillments/%s/events/%s.json', 'fulfillment_event', 'fulfillment_event'));
28 5
        $this->actions->add('all', new Action(Request::METHOD_GET, 'orders/%s/fulfillments/%s/events.json', 'fulfillment_events', 'fulfillment_events'));
29 5
        $this->actions->add('delete', new Action(Request::METHOD_DELETE, 'orders/%s/fulfillments/%s/events/%s.json'));
30 5
    }
31
}
32