Completed
Push — master ( 39a0bd...0a53a0 )
by Fabian
02:26
created

SpreadDataRequest   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 59
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 59
ccs 17
cts 17
cp 1
rs 10
c 0
b 0
f 0
wmc 6

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getRequestData() 0 8 2
A getMethod() 0 3 1
A __construct() 0 4 1
A getVisibility() 0 3 1
A getResponseClassName() 0 3 1
1
<?php
2
3
namespace HanischIt\KrakenApi\Call\SpreadData;
4
5
use HanischIt\KrakenApi\Enum\VisibilityEnum;
6
use HanischIt\KrakenApi\Model\RequestInterface;
7
8
/**
9
 * Class SpreadDataRequest
10
 * @package HanischIt\KrakenApi\Call\SpreadData
11
 */
12
class SpreadDataRequest implements RequestInterface
13
{
14
    /**
15
     * @var
16
     */
17
    private $assetPair;
18
    /**
19
     * @var null
20
     */
21
    private $since;
22
23
    /**
24
     * OrderBookRequest constructor.
25
     * @param $assetPair
26
     * @param null|mixed $since
27
     */
28 2
    public function __construct($assetPair, $since = null)
29
    {
30 2
        $this->assetPair = $assetPair;
31 2
        $this->since = $since;
32 2
    }
33
34
    /**
35
     * Returns the api request name
36
     *
37
     * @return string
38
     */
39 1
    public function getMethod()
40
    {
41 1
        return 'Spread';
42
    }
43
44
    /**
45
     * @return string
46
     */
47 1
    public function getVisibility()
48
    {
49 1
        return VisibilityEnum::VISIBILITY_PUBLIC;
50
    }
51
52
    /**
53
     * @return array
54
     */
55 1
    public function getRequestData()
56
    {
57 1
        $arr = [];
58 1
        $arr["pair"] = $this->assetPair;
59 1
        if ($this->since) {
60 1
            $arr["since"] = $this->since;
61 1
        }
62 1
        return $arr;
63
    }
64
65
    /**
66
     * @return string
67
     */
68 1
    public function getResponseClassName()
69
    {
70 1
        return SpreadDataResponse::class;
71
    }
72
}
73