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

Blog   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 72
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 72
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/blog
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
 * @property BlogMetaField $metafields
19
 * @property Article $articles
20
 */
21
class Blog extends AbstractResource implements Resource
22
{
23
    /**
24
     * @var array
25
     */
26
    protected $childResources = [
27
        'metafields' => BlogMetaField::class,
28
        'articles'   => Article::class,
29
    ];
30
31
    /**
32
     * Blog constructor.
33
     * @param Request $request
34
     */
35 5
    public function __construct(Request $request)
36
    {
37 5
        parent::__construct($request);
38
39 5
        $this->actions->add(
40 5
            'create',
41 5
            new Action(
42 5
                Request::METHOD_POST,
43 5
                'blogs.json',
44 5
                'blog',
45 5
                'blog'
46
            )
47
        );
48 5
        $this->actions->add(
49 5
            'get',
50 5
            new Action(
51 5
                Request::METHOD_GET,
52 5
                'blogs/%s.json',
53 5
                'blog',
54 5
                'blog'
55
            )
56
        );
57 5
        $this->actions->add(
58 5
            'all',
59 5
            new Action(
60 5
                Request::METHOD_GET,
61 5
                'blogs.json',
62 5
                'blogs',
63 5
                'blogs'
64
            )
65
        );
66 5
        $this->actions->add(
67 5
            'count',
68 5
            new Action(
69 5
                Request::METHOD_GET,
70 5
                'blogs/count.json',
71 5
                'count',
72 5
                'count'
73
            )
74
        );
75 5
        $this->actions->add(
76 5
            'update',
77 5
            new Action(
78 5
                Request::METHOD_PUT,
79 5
                'blogs/%s.json',
80 5
                'blog',
81 5
                'blog'
82
            )
83
        );
84 5
        $this->actions->add(
85 5
            'delete',
86 5
            new Action(
87 5
                Request::METHOD_DELETE,
88 5
                'blogs/%s.json'
89
            )
90
        );
91 5
    }
92
}
93