Cash   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A create() 0 8 1
A get() 0 8 1
1
<?php
2
3
namespace Uon\Endpoints;
4
5
use Uon\Client;
6
7
/**
8
 * Class Cash
9
 *
10
 * @package Uon\Endpoint
11
 */
12
class Cash extends Client
13
{
14
    /**
15
     * @var string
16
     */
17
    protected $namespace = __CLASS__;
18
19
    /**
20
     * Get a list of checkouts
21
     *
22
     * @link https://api.u-on.ru/{key}/cash.{_format}
23
     *
24
     * @param array $parameters List of parameters ['id', 'name', 'name_en']
25
     *
26
     * @return null|object|\Uon\Interfaces\ClientInterface
27
     */
28
    public function get(array $parameters = [])
29
    {
30
        // Set HTTP params
31
        $this->type     = 'get';
32
        $this->endpoint = 'cash';
33
        $this->params   = $parameters;
34
35
        return $this->done();
36
    }
37
38
    /**
39
     * Add new cashbox
40
     *
41
     * @link https://api.u-on.ru/{key}/cash/create.{_format}
42
     *
43
     * @param array $parameters List of parameters ['name']
44
     *
45
     * @return null|object|\Uon\Interfaces\ClientInterface
46
     */
47
    public function create(array $parameters)
48
    {
49
        // Set HTTP params
50
        $this->type     = 'post';
51
        $this->endpoint = 'cash/create';
52
        $this->params   = $parameters;
53
54
        return $this->done();
55
    }
56
}
57