ProductImage   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

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