Completed
Push — master ( e41c6a...6a7f08 )
by Saurabh
03:07
created

Statistics::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 3
dl 0
loc 6
ccs 5
cts 5
cp 1
crap 1
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace Sausin\Signere;
4
5
class Statistics extends BaseClass
6
{
7
    /** The URI of the action */
8
    const URI = 'https://api.signere.no/api/Statistics';
9
10
    /**
11
     * Returns a statistics response object with various information.
12
     *
13
     * @param  int|null $year
14
     * @param  int|null $month
15
     * @param  int|null $day
16
     * @param  string   $status
17
     * @return object
18
     */
19 1
    public function get(int $year = null, int $month = null, int $day = null, string $status = 'All')
20
    {
21
        // make the URL for this request
22 1
        $url = $this->transformUrl(sprintf(
23 1
            '%s?Year=%s&Month=%s&Day=%s&Status=%s',
24 1
            self::URI,
25
            $year,
26
            $month,
27
            $day,
28
            $status
29
        ));
30
31
        // get the headers for this request
32 1
        $headers = $this->headers->make('GET', $url);
33
34
        // get the response
35 1
        $response = $this->client->get($url, [
36 1
            'headers' => $headers,
37
        ]);
38
39
        // return the response
40 1
        return $response;
41
    }
42
}
43