Organizations::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
1
<?php
2
3
namespace CybozuHttp\Api\User;
4
5
/**
6
 * @author ochi51 <[email protected]>
7
 */
8
class Organizations
9
{
10
    /**
11
     * @var Csv
12
     */
13
    private $csv;
14
15
    /**
16
     * Organizations constructor.
17
     * @param Csv $csv
18
     */
19 1
    public function __construct(Csv $csv)
20
    {
21 1
        $this->csv = $csv;
22
    }
23
24
    /**
25
     * Get organizations by csv
26
     * https://cybozudev.zendesk.com/hc/ja/articles/202124754
27
     *
28
     * @return string
29
     * @throws \InvalidArgumentException
30
     */
31 3
    public function getByCsv(): string
32
    {
33 3
        return $this->csv->get('organization');
34
    }
35
36
    /**
37
     * Post organizations by csv
38
     * https://cybozudev.zendesk.com/hc/ja/articles/202350640
39
     *
40
     * @param $filename
41
     * @return int
42
     * @throws \InvalidArgumentException
43
     */
44 3
    public function postByCsv($filename): int
45
    {
46 3
        return $this->csv->post('organization', $filename);
47
    }
48
}
49