Exchanges   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 5
c 1
b 0
f 1
dl 0
loc 28
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A exchange() 0 3 1
1
<?php
2
3
namespace RevolutPHP;
4
5
class Exchanges
6
{
7
    const ENDPOINT = 'exchange';
8
9
    /**
10
     * @var Client
11
     */
12
    private $client;
13
14
    /**
15
     * Exchanges 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/#exchange-currency
25
     *
26
     * @param array $json
27
     * @return mixed
28
     * @throws \GuzzleHttp\Exception\GuzzleException
29
     */
30
    public function exchange(array $json)
31
    {
32
        return $this->client->post(self::ENDPOINT, $json);
33
    }
34
}
35