PingHandler::ping()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 4
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 6
ccs 5
cts 5
cp 1
crap 1
rs 10
1
<?php
2
/**
3
 * File: PingHandler.php
4
 *
5
 * @author      Maciej Sławik <[email protected]>
6
 * Github:      https://github.com/maciejslawik
7
 */
8
9
namespace MSlwk\FreshMail\Handler\Ping;
10
11
use MSlwk\FreshMail\Handler\AbstractHandler;
12
13
/**
14
 * Class PingHandler
15
 *
16
 * @package MSlwk\FreshMail\Handler\Ping
17
 */
18
class PingHandler extends AbstractHandler
19
{
20
    const API_ENDPOINT = '/rest/ping';
21
22
    /**
23
     * @return string
24
     */
25 49
    public function ping(): string
26
    {
27 49
        $getParameters = [];
28 49
        $postParameters = [];
29 49
        $response = $this->processRequest($getParameters, $postParameters);
30 7
        return $response->data;
31
    }
32
33
    /**
34
     * @return string
35
     */
36 7
    protected function getApiEndpoint(): string
37
    {
38 7
        return self::API_ENDPOINT;
39
    }
40
}
41