Completed
Push — fix-file-api ( 87a3c2 )
by Yuichi
07:19
created

UserServices   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 75%

Importance

Changes 0
Metric Value
wmc 3
c 0
b 0
f 0
lcom 1
cbo 1
dl 0
loc 41
ccs 6
cts 8
cp 0.75
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A postByCsv() 0 4 1
A getByCsv() 0 4 1
1
<?php
2
3
namespace CybozuHttp\Api\User;
4
5
use CybozuHttp\Client;
6
7
/**
8
 * @author ochi51 <[email protected]>
9
 */
10
class UserServices
11
{
12
    /**
13
     * @var Client
14
     */
15
    private $client;
16
17
    /**
18
     * @var Csv
19
     */
20
    private $csv;
21
22 1
    public function __construct(Client $client, Csv $csv)
23
    {
24 1
        $this->client = $client;
25 1
        $this->csv = $csv;
26 1
    }
27
28
    /**
29
     * Get userServices by csv
30
     * https://cybozudev.zendesk.com/hc/ja/articles/202363070
31
     *
32
     * @return string
33
     */
34
    public function getByCsv()
35
    {
36
        return $this->csv->get('userServices');
37
    }
38
39
    /**
40
     * Post userServices by csv
41
     * https://cybozudev.zendesk.com/hc/ja/articles/202124734
42
     *
43
     * @param $filename
44
     * @return int
45
     */
46 1
    public function postByCsv($filename)
47
    {
48 1
        return $this->csv->post('userServices', $filename);
49
    }
50
}