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

Settings::fetch()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 3
cts 3
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 0
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Billogram\Api;
6
7
use Billogram\Model\Setting\Setting;
8
use Psr\Http\Message\ResponseInterface;
9
10
/**
11
 * @author Ibrahim Hizeoui <[email protected]>
12
 */
13
class Settings extends HttpApi
14
{
15
    /**
16
     * @return Setting|ResponseInterface
17
     *
18
     * @see https://billogram.com/api/documentation#settings_fetch
19
     */
20 1
    public function fetch()
21
    {
22 1
        $response = $this->httpGet('/settings');
23
24 1
        return $this->handleResponse($response, Setting::class);
25
    }
26
27
    /**
28
     * @param array $setting
29
     *
30
     * @return Setting|ResponseInterface
31
     *
32
     * @see https://billogram.com/api/documentation#settings_fetch
33
     */
34 1
    public function update(array $setting)
35
    {
36 1
        $response = $this->httpPUT('/settings', $setting);
37
38 1
        return $this->handleResponse($response, Setting::class);
39
    }
40
}
41