Statistics   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 38
ccs 12
cts 12
cp 1
rs 10
c 0
b 0
f 0
wmc 1
lcom 1
cbo 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A get() 0 23 1
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 = sprintf(
23 1
            '%s?Year=%s&Month=%s&Day=%s&Status=%s',
24 1
            self::URI,
25 1
            $year,
26 1
            $month,
27 1
            $day,
28 1
            $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