Passed
Push — master ( f86309...3fa716 )
by Mr
01:59 queued 22s
created

Cash   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 26
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A get() 0 4 1
A create() 0 4 1
1
<?php
2
3
namespace UON\Endpoint;
4
5
use UON\Client;
6
7
/**
8
 * Class Cash
9
 * @package UON
10
 */
11
class Cash extends Client
12
{
13
    /**
14
     * Get a list of checkouts
15
     *
16
     * @link    https://api.u-on.ru/{key}/cash.{_format}
17
     * @param   array $parameters - List of parameters ['id', 'name', 'name_en']
18
     * @return  array|false
19
     */
20
    public function get(array $parameters = [])
21
    {
22
        $endpoint = '/cash';
23
        return $this->doRequest('get', $endpoint, $parameters);
24
    }
25
26
    /**
27
     * Add new cashbox
28
     *
29
     * @link    https://api.u-on.ru/{key}/cash/create.{_format}
30
     * @param   array $parameters - List of parameters ['name']
31
     * @return  array|false
32
     */
33
    public function create(array $parameters)
34
    {
35
        $endpoint = '/cash/create';
36
        return $this->doRequest('post', $endpoint, $parameters);
37
    }
38
}
39