Passed
Push — master ( 5e9e3d...710625 )
by Maciej
04:36 queued 11s
created

CampaignDeleteHandler   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
c 1
b 0
f 0
dl 0
loc 26
ccs 8
cts 8
cp 1
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getApiEndpoint() 0 3 1
A deleteCampaign() 0 10 1
1
<?php
2
/**
3
 * File: CampaignDeleteHandler.php
4
 *
5
 * @author      Maciej Sławik <[email protected]>
6
 * Github:      https://github.com/maciejslawik
7
 */
8
9
namespace MSlwk\FreshMail\Handler\Campaign;
10
11
use MSlwk\FreshMail\Handler\AbstractHandler;
12
13
/**
14
 * Class CampaignDeleteHandler
15
 *
16
 * @package MSlwk\FreshMail\Handler\Campaign
17
 */
18
class CampaignDeleteHandler extends AbstractHandler
19
{
20
    const API_ENDPOINT = '/rest/campaigns/delete';
21
22
    /**
23
     * @param string $campaignHash
24
     * @return null
25
     */
26 21
    public function deleteCampaign(
27
        string $campaignHash
28
    ) {
29 21
        $getParameters = [];
30 6
        $postParameters = [
31 21
            'hash' => $campaignHash
32
        ];
33
34 21
        $this->processRequest($getParameters, $postParameters);
35 7
        return null;
36
    }
37
38
    /**
39
     * @return string
40
     */
41 7
    protected function getApiEndpoint(): string
42
    {
43 7
        return self::API_ENDPOINT;
44
    }
45
}