Country   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 71
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 3
dl 0
loc 71
ccs 43
cts 43
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 57 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/country
10
 *
11
 * @method create(array $parameters = [])
12
 * @method get(float $parentId)
13
 * @method all(float $parentId)
14
 * @method count(float $parentId)
15
 * @method update(float $parentId, array $parameters = [])
16
 * @method delete(float $parentId)
17
 */
18
class Country extends AbstractResource implements Resource
19
{
20
    /**
21
     * @var array
22
     */
23
    protected $childResources = [
24
        'provinces' => Province::class,
25
    ];
26
27
    /**
28
     * Country constructor.
29
     * @param Request $request
30
     */
31 5
    public function __construct(Request $request)
32
    {
33 5
        parent::__construct($request);
34
35 5
        $this->actions->add(
36 5
            'create',
37 5
            new Action(
38 5
                Request::METHOD_POST,
39 5
                'countries.json',
40 5
                'country',
41 5
                'country'
42
            )
43
        );
44 5
        $this->actions->add(
45 5
            'get',
46 5
            new Action(
47 5
                Request::METHOD_GET,
48 5
                'countries/%s.json',
49 5
                'country',
50 5
                'country'
51
            )
52
        );
53 5
        $this->actions->add(
54 5
            'all',
55 5
            new Action(
56 5
                Request::METHOD_GET,
57 5
                'countries.json',
58 5
                'countries',
59 5
                'countries'
60
            )
61
        );
62 5
        $this->actions->add(
63 5
            'count',
64 5
            new Action(
65 5
                Request::METHOD_GET,
66 5
                'countries/count.json',
67 5
                'count',
68 5
                'count'
69
            )
70
        );
71 5
        $this->actions->add(
72 5
            'update',
73 5
            new Action(
74 5
                Request::METHOD_PUT,
75 5
                'countries/%s.json',
76 5
                'country',
77 5
                'country'
78
            )
79
        );
80 5
        $this->actions->add(
81 5
            'delete',
82 5
            new Action(
83 5
                Request::METHOD_DELETE,
84 5
                'countries/%s.json'
85
            )
86
        );
87 5
    }
88
}
89