Passed
Push — develop ( 375edc...65434e )
by Edwin
02:48
created

Article   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 46
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 46
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A tags() 0 8 1
A authors() 0 6 1
1
<?php
2
3
namespace ShopifyClient\Resource;
4
5
/**
6
 * https://help.shopify.com/api/reference/article
7
 */
8
class Article extends AbstractNestedCountableCrudResource
9
{
10
    /**
11
     * @var string
12
     */
13
    protected $resourceParentEndpointPleural = 'blogs';
14
15
    /**
16
     * @var string
17
     */
18
    protected $resourceChildEndpointPleural = 'articles';
19
20
    /**
21
     * @var string
22
     */
23
    protected $resourceChildKeySingular = 'article';
24
25
    /**
26
     * @var string
27
     */
28
    protected $resourceChildKeyPleural = 'articles';
29
30
    /**
31
     * @param float $id
32
     * @param array $query
33
     * @return array
34
     */
35 1
    public function tags(float $id, array $query = [])
36
    {
37 1
        $response = $this->request('GET', sprintf('/admin/blogs/%s/articles/tags.json', $id), [
38 1
            'query' => $query,
39
        ]);
40
41 1
        return $response['tags'];
42
    }
43
44
    /**
45
     * @return array
46
     */
47 1
    public function authors()
48
    {
49 1
        $response = $this->request('GET', '/admin/articles/authors.json');
50
51 1
        return $response['authors'];
52
    }
53
}
54