Titles   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 5
c 2
b 0
f 0
dl 0
loc 39
ccs 6
cts 6
cp 1
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A getByCsv() 0 3 1
A postByCsv() 0 3 1
1
<?php
2
3
namespace CybozuHttp\Api\User;
4
5
/**
6
 * @author ochi51 <[email protected]>
7
 */
8
class Titles
9
{
10
    /**
11
     * @var Csv
12
     */
13
    private $csv;
14
15
    /**
16
     * Titles constructor.
17
     * @param Csv $csv
18
     */
19 1
    public function __construct(Csv $csv)
20
    {
21 1
        $this->csv = $csv;
22
    }
23
24
    /**
25
     * Get titles by csv
26
     * https://cybozudev.zendesk.com/hc/ja/articles/202124764
27
     *
28
     * @return string
29
     * @throws \InvalidArgumentException
30
     */
31 1
    public function getByCsv(): string
32
    {
33 1
        return $this->csv->get('title');
34
    }
35
36
    /**
37
     * Post titles by csv
38
     * https://cybozudev.zendesk.com/hc/ja/articles/202361180
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('title', $filename);
47
    }
48
}
49