Completed
Push — develop ( fbac2a...fa8907 )
by Edwin
04:58
created

Article::authors()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 3
cts 3
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 0
crap 1
1
<?php
2
3
namespace ShopifyClient\Resource;
4
5
/**
6
 * https://help.shopify.com/api/reference/article
7
 *
8
 * @method create(float $parentId, array $parameters = [])
9
 * @method get(float $parentId, float $childId)
10
 * @method all(float $parentId, array $parameters = [])
11
 * @method count(float $parentId)
12
 * @method update(float $parentId, float $childId, array $parameters = [])
13
 * @method tags(float $parentId, array $parameters = [])
14
 * @method authors
15
 * @method delete(float $parentId, float $childId)
16
 *
17
 * @property ArticleMetaField $metafields
18
 * @property CustomerAddress $addresses
19
 */
20
class Article extends AbstractResource implements Resource
21
{
22
    /**
23
     * @var array
24
     */
25
    protected $actions = [
26
        'create'  => [
27
            'method'      => 'POST',
28
            'endpoint'    => 'blogs/%s/articles.json',
29
            'resourceKey' => 'article',
30
            'responseKey' => 'article',
31
        ],
32
        'get'     => [
33
            'method'      => 'GET',
34
            'endpoint'    => 'blogs/%s/articles/%s.json',
35
            'resourceKey' => 'article',
36
            'responseKey' => 'article',
37
        ],
38
        'all'     => [
39
            'method'      => 'GET',
40
            'endpoint'    => 'blogs/%s/articles.json',
41
            'resourceKey' => 'articles',
42
            'responseKey' => 'articles',
43
        ],
44
        'count'   => [
45
            'method'      => 'GET',
46
            'endpoint'    => 'blogs/%s/articles/count.json',
47
            'resourceKey' => 'count',
48
            'responseKey' => 'count',
49
        ],
50
        'update'  => [
51
            'method'      => 'PUT',
52
            'endpoint'    => 'blogs/%s/articles/%s.json',
53
            'resourceKey' => 'article',
54
            'responseKey' => 'article',
55
        ],
56
        'tags'    => [
57
            'method'      => 'GET',
58
            'endpoint'    => 'blogs/%s/articles/tags.json',
59
            'resourceKey' => 'tags',
60
            'responseKey' => 'tags',
61
        ],
62
        'authors' => [
63
            'method'      => 'GET',
64
            'endpoint'    => 'articles/authors.json',
65
            'resourceKey' => 'authors',
66
            'responseKey' => 'authors',
67
        ],
68
        'delete'  => [
69
            'method'   => 'DELETE',
70
            'endpoint' => 'blogs/%s/articles/%s.json',
71
        ],
72
    ];
73
74
    protected $childResources = [
75
        'metafields' => ArticleMetaField::class,
76
    ];
77
}
78