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

UserServices::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 5
ccs 4
cts 4
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 2
crap 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
}