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

User::__construct()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 32
Code Lines 23

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 24
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 32
ccs 24
cts 24
cp 1
rs 8.8571
c 0
b 0
f 0
cc 1
eloc 23
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/user
10
 *
11
 * @method get(float $parentId)
12
 * @method all
13
 * @method current(float $parentId)
14
 */
15
class User extends AbstractResource implements Resource
16
{
17
    /**
18
     * User constructor.
19
     * @param Request $request
20
     */
21 5
    public function __construct(Request $request)
22
    {
23 5
        parent::__construct($request);
24
25 5
        $this->actions->add(
26 5
            'get',
27 5
            new Action(
28 5
                Request::METHOD_GET,
29 5
                'users/%s.json',
30 5
                'user',
31 5
                'user'
32
            )
33
        );
34 5
        $this->actions->add(
35 5
            'all',
36 5
            new Action(
37 5
                Request::METHOD_GET,
38 5
                'users.json',
39 5
                'users',
40 5
                'users'
41
            )
42
        );
43 5
        $this->actions->add(
44 5
            'current',
45 5
            new Action(
46 5
                Request::METHOD_GET,
47 5
                'users/%s.json',
48 5
                'user',
49 5
                'user'
50
            )
51
        );
52 5
    }
53
}
54