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

UserServices::getByCsv()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

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