Completed
Push — master ( f2b799...761b51 )
by Tobias
04:02
created

Report   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 1
dl 0
loc 31
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A fetch() 0 6 1
A search() 0 7 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Billogram\Api;
6
7
use Billogram\Model\Report\ReportCollection;
8
use Billogram\Model\Report\Report as Model;
9
use Psr\Http\Message\ResponseInterface;
10
11
class Report extends HttpApi
12
{
13
    /**
14
     * @param string $fileName
15
     *
16
     * @return Model|ResponseInterface
17
     *
18
     * @see https://billogram.com/api/documentation#reports
19
     */
20 1
    public function fetch(string $fileName)
21
    {
22 1
        $response = $this->httpGet('/report/'.$fileName);
23
24 1
        return $this->handleResponse($response, Model::class);
25
    }
26
27
    /**
28
     * @param array $param
29
     *
30
     * @return ReportCollection|ResponseInterface
31
     *
32
     * @see https://billogram.com/api/documentation#reports
33
     */
34 1
    public function search(array $param = [])
35
    {
36 1
        $param = array_merge(['page' => 1, 'page_size' => 100], $param);
37 1
        $response = $this->httpGet('/report', $param);
38
39 1
        return $this->handleResponse($response, ReportCollection::class);
40
    }
41
}
42