Accounts   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 51
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
c 1
b 0
f 0
dl 0
loc 51
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getDetails() 0 3 1
A __construct() 0 3 1
A all() 0 3 1
A get() 0 3 1
1
<?php
2
3
namespace RevolutPHP;
4
5
class Accounts
6
{
7
    const ENDPOINT = 'accounts';
8
9
    /**
10
     * @var Client
11
     */
12
    private $client;
13
14
    /**
15
     * Account constructor.
16
     * @param Client $client
17
     */
18
    public function __construct(Client $client)
19
    {
20
        $this->client = $client;
21
    }
22
23
    /**
24
     * @see https://revolutdev.github.io/business-api/#get-accounts
25
     *
26
     * @return mixed
27
     * @throws \GuzzleHttp\Exception\GuzzleException
28
     */
29
    public function all()
30
    {
31
        return $this->client->get(self::ENDPOINT);
32
    }
33
34
    /**
35
     * @see https://revolutdev.github.io/business-api/#get-account
36
     *
37
     * @param string $id
38
     * @return mixed
39
     * @throws \GuzzleHttp\Exception\GuzzleException
40
     */
41
    public function get(string $id)
42
    {
43
        return $this->client->get(self::ENDPOINT.'/'.$id);
44
    }
45
46
    /**
47
     * @see https://revolutdev.github.io/business-api/#get-account-details
48
     *
49
     * @param string $id
50
     * @return mixed
51
     * @throws \GuzzleHttp\Exception\GuzzleException
52
     */
53
    public function getDetails(string $id)
54
    {
55
        return $this->client->get(self::ENDPOINT.'/'.$id.'/bank-details');
56
    }
57
}
58