Code Duplication    Length = 9-12 lines in 5 locations

src/Endpoint/Discount.php 1 location

@@ 311-319 (lines=9) @@
308
     * @param int $id
309
     * @return bool
310
     */
311
    public function deleteSalesDiscount(int $id) : bool
312
    {
313
        Assert::that($id)->greaterThan(0, '$id must be positive');
314
315
        return (bool)$this->master->doRequest(
316
            'DELETE',
317
            sprintf('/admin/WEBAPI/Endpoints/v1_0/DiscountService/{KEY}/salesDiscount/%d', $id)
318
        );
319
    }
320
321
    /*
322
     * Helper methods

src/Endpoint/Plugin.php 3 locations

@@ 17-27 (lines=11) @@
14
     * @param int $appId
15
     * @return array
16
     */
17
    public function getSiteInfo(int $appId) : array
18
    {
19
        Assert::that($appId)->greaterThan(0, 'The $appId has to be positive');
20
        return (array)$this->master->doRequest(
21
            'GET',
22
            sprintf(
23
                '/admin/WEBAPI/Endpoints/v1_0/PluginService/{KEY}/SiteInfo/%s',
24
                $appId
25
            )
26
        );
27
    }
28
    
29
    /**
30
     * @see https://shoppartner.dandomain.dk/dokumentation/app-developer/
@@ 36-47 (lines=12) @@
33
     * @param array\stdClass $body
34
     * @return array
35
     */
36
    public function updateAppScripts(int $appId, $body) : array
37
    {
38
        Assert::that($appId)->greaterThan(0, 'The $appId has to be positive');
39
        return (array)$this->master->doRequest(
40
            'POST',
41
            sprintf(
42
                '/admin/WEBAPI/Endpoints/v1_0/PluginService/{KEY}/%s/SetAppScript',
43
                $appId
44
            ),
45
            $body
46
        );
47
    }
48
49
    /**
50
     * @see https://shoppartner.dandomain.dk/dokumentation/app-developer/
@@ 56-67 (lines=12) @@
53
     * @param int $pageType
54
     * @return boolean
55
     */
56
    public function deleteAppScripts(int $appId, int $pageType) : bool
57
    {
58
        Assert::that($appId)->greaterThan(0, 'The $appId has to be positive');
59
        return (bool)$this->master->doRequest(
60
            'DELETE',
61
            sprintf(
62
                '/admin/WEBAPI/Endpoints/v1_0/PluginService/{KEY}/DeleteAppScriptForPage?appId=%s&pageType=%s',
63
                $appId,
64
                $pageType
65
            )
66
        );
67
    }
68
}
69

src/Endpoint/ProductTag.php 1 location

@@ 87-95 (lines=9) @@
84
     * @param int $id
85
     * @return boolean
86
     */
87
    public function deleteProductTag(int $id) : bool
88
    {
89
        Assert::that($id)->greaterThan(0, '$id has to be positive');
90
91
        return (bool)$this->master->doRequest(
92
            'DELETE',
93
            sprintf('/admin/WEBAPI/Endpoints/v1_0/ProductTagService/{KEY}/%d', $id)
94
        );
95
    }
96
97
    /**
98
     * @param string $productNumber