Ping   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 3
Bugs 0 Features 0
Metric Value
wmc 2
c 3
b 0
f 0
lcom 1
cbo 1
dl 0
loc 32
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A whoAmI() 0 7 1
1
<?php
2
3
namespace Thepixeldeveloper\Mondo\Client;
4
5
use Thepixeldeveloper\Mondo\ClientInterface;
6
use Thepixeldeveloper\Mondo\Response;
7
8
/**
9
 * Class Ping
10
 *
11
 * @package Thepixeldeveloper\Mondo\Client
12
 */
13
class Ping
14
{
15
    /**
16
     * Mondo client.
17
     *
18
     * @var ClientInterface
19
     */
20
    protected $client;
21
22
    /**
23
     * Accounts constructor.
24
     *
25
     * @param ClientInterface $client
26
     */
27
    public function __construct(ClientInterface $client)
28
    {
29
        $this->client = $client;
30
    }
31
32
    /**
33
     * Get details about the current client.
34
     *
35
     * @return Response\Ping\WhoAmI
36
     */
37
    public function whoAmI()
38
    {
39
        return $this->client->deserializeResponse(
40
            $this->client->get('/ping/whoami'),
41
            Response\Ping\WhoAmI::class
42
        );
43
    }
44
}
45