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

SubscriberDeleteHandler   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

2 Methods

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