Report::search()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7

Duplication

Lines 7
Ratio 100 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
dl 7
loc 7
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 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
/**
12
 * @see https://billogram.com/api/documentation#reports
13
 */
14
class Report extends HttpApi
15
{
16
    /**
17
     * @param array $param
18
     *
19
     * @return ReportCollection|ResponseInterface
20
     *
21
     * @see https://billogram.com/api/documentation#reports_list
22
     */
23 1 View Code Duplication
    public function search(array $param = [])
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
24
    {
25 1
        $param = array_merge(['page' => 1, 'page_size' => 100], $param);
26 1
        $response = $this->httpGet('/report', $param);
27
28 1
        return $this->handleResponse($response, ReportCollection::class);
29
    }
30
31
    /**
32
     * @param string $fileName
33
     *
34
     * @return Model|ResponseInterface
35
     *
36
     * @see https://billogram.com/api/documentation#reports_fetch
37
     */
38 1
    public function fetch(string $fileName)
39
    {
40 1
        $response = $this->httpGet('/report/'.$fileName);
41
42 1
        return $this->handleResponse($response, Model::class);
43
    }
44
}
45