Accounts::getAccounts()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 7
rs 9.4285
cc 1
eloc 4
nc 1
nop 0
1
<?php
2
3
namespace Thepixeldeveloper\Mondo\Client;
4
5
use Thepixeldeveloper\Mondo\ClientInterface;
6
use Thepixeldeveloper\Mondo\Response;
7
8
/**
9
 * Class Accounts
10
 *
11
 * @package Thepixeldeveloper\Mondo\Client
12
 */
13
class Accounts
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 a list of accounts for the authorised user.
34
     *
35
     * @return Response\Accounts
36
     */
37
    public function getAccounts()
38
    {
39
        return $this->client->deserializeResponse(
40
            $this->client->get('/accounts'),
41
            Response\Accounts::class
42
        );
43
    }
44
}
45