SubscriberGetHandler   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
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 27
ccs 9
cts 9
cp 1
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getApiEndpoint() 0 3 1
A getSubscriber() 0 10 1
1
<?php
2
/**
3
 * File: SubscriberGetHandler.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 SubscriberGetHandler
15
 *
16
 * @package MSlwk\FreshMail\Handler\Subscriber
17
 */
18
class SubscriberGetHandler extends AbstractHandler
19
{
20
    const API_ENDPOINT = '/rest/subscriber/get';
21
22
    /**
23
     * @param string $email
24
     * @param string $listHash
25
     * @return \stdClass
26
     */
27 21
    public function getSubscriber(string $email, string $listHash): \stdClass
28
    {
29 6
        $getParameters = [
30 21
            $listHash,
31 21
            $email
32
        ];
33 21
        $postParameters = [];
34
35 21
        $response = $this->processRequest($getParameters, $postParameters);
36 7
        return $response->data;
37
    }
38
39
    /**
40
     * @return string
41
     */
42 7
    protected function getApiEndpoint(): string
43
    {
44 7
        return self::API_ENDPOINT;
45
    }
46
}
47