Settings   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 89
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 6
lcom 0
cbo 3
dl 0
loc 89
ccs 0
cts 27
cp 0
rs 10
c 0
b 0
f 0

6 Methods

Rating   Name   Duplication   Size   Complexity  
A getSites() 0 7 1
A getCountries() 0 7 1
A getCurrencies() 0 7 1
A getPaymentMethods() 0 9 1
A getShippingMethods() 0 9 1
A getCompanyInfo() 0 9 1
1
<?php
2
namespace Loevgaard\Dandomain\Api\Endpoint;
3
4
use Assert\Assert;
5
6
/**
7
 * @see http://4221117.shop53.dandomain.dk/admin/webapi/endpoints/v1_0/SettingService/help
8
 */
9
class Settings extends Endpoint
10
{
11
    /**
12
     * @see http://4221117.shop53.dandomain.dk/admin/webapi/endpoints/v1_0/SettingService/help/operations/GetSites
13
     *
14
     * @return array
15
     */
16
    public function getSites() : array
17
    {
18
        return (array)$this->master->doRequest(
19
            'GET',
20
            '/admin/WEBAPI/Endpoints/v1_0/SettingService/{KEY}/Sites'
21
        );
22
    }
23
24
    /**
25
     * @see http://4221117.shop53.dandomain.dk/admin/webapi/endpoints/v1_0/SettingService/help/operations/GetCountries
26
     *
27
     * @return array
28
     */
29
    public function getCountries() : array
30
    {
31
        return (array)$this->master->doRequest(
32
            'GET',
33
            '/admin/WEBAPI/Endpoints/v1_0/SettingService/{KEY}/Countries'
34
        );
35
    }
36
37
    /**
38
     * @see http://4221117.shop53.dandomain.dk/admin/webapi/endpoints/v1_0/SettingService/help/operations/GetCurrencies
39
     *
40
     * @return array
41
     */
42
    public function getCurrencies() : array
43
    {
44
        return (array)$this->master->doRequest(
45
            'GET',
46
            '/admin/WEBAPI/Endpoints/v1_0/SettingService/{KEY}/Currencies'
47
        );
48
    }
49
50
    /**
51
     * @see http://4221117.shop53.dandomain.dk/admin/webapi/endpoints/v1_0/SettingService/help/operations/GetPaymentMethods
52
     *
53
     * @param int $siteId
54
     * @return array
55
     */
56
    public function getPaymentMethods(int $siteId) : array
57
    {
58
        Assert::that($siteId)->greaterThan(0, 'The $siteId has to be positive');
59
60
        return (array)$this->master->doRequest(
61
            'GET',
62
            sprintf('/admin/WEBAPI/Endpoints/v1_0/SettingService/{KEY}/PaymentMethods/%d', $siteId)
63
        );
64
    }
65
66
    /**
67
     * @see http://4221117.shop53.dandomain.dk/admin/webapi/endpoints/v1_0/SettingService/help/operations/GetShippingMethods
68
     *
69
     * @param int $siteId
70
     * @return array
71
     */
72
    public function getShippingMethods(int $siteId) : array
73
    {
74
        Assert::that($siteId)->greaterThan(0, 'The $siteId has to be positive');
75
76
        return (array)$this->master->doRequest(
77
            'GET',
78
            sprintf('/admin/WEBAPI/Endpoints/v1_0/SettingService/{KEY}/ShippingMethods/%d', $siteId)
79
        );
80
    }
81
82
    /**
83
     * @see http://4221117.shop53.dandomain.dk/admin/webapi/endpoints/v1_0/SettingService/help/operations/GetCompanyInfo
84
     *
85
     * @param int $siteId
86
     * @return array
87
     */
88
    public function getCompanyInfo(int $siteId) : array
89
    {
90
        Assert::that($siteId)->greaterThan(0, 'The $siteId has to be positive');
91
92
        return (array)$this->master->doRequest(
93
            'GET',
94
            sprintf('/admin/WEBAPI/Endpoints/v1_0/SettingService/{KEY}/CompanyInfo/%d', $siteId)
95
        );
96
    }
97
}
98