Passed
Push — master ( 37b5d9...f0b58d )
by Fabian
02:07
created

SpreadDataRequest::getVisibility()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 3
Ratio 100 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 3
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 1
b 0
f 0
1
<?php
2
3
namespace HanischIt\KrakenApi\Model\SpreadData;
4
5
use HanischIt\KrakenApi\Enum\VisibilityEnum;
6
use HanischIt\KrakenApi\Model\RequestInterface;
7
8
/**
9
 * Class SpreadDataRequest
10
 *
11
 * @package HanischIt\KrakenApi\Model\SpreadData
12
 */
13 View Code Duplication
class SpreadDataRequest implements RequestInterface
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
14
{
15
    /**
16
     * @var
17
     */
18
    private $assetPair;
19
    /**
20
     * @var null
21
     */
22
    private $since;
23
24
    /**
25
     * OrderBookRequest constructor.
26
     * @param $assetPair
27
     * @param null|mixed $since
28
     */
29 2
    public function __construct($assetPair, $since = null)
30
    {
31 2
        $this->assetPair = $assetPair;
32 2
        $this->since = $since;
33 2
    }
34
35
    /**
36
     * Returns the api request name
37
     *
38
     * @return string
39
     */
40 1
    public function getMethod()
41
    {
42 1
        return 'Spread';
43
    }
44
45
    /**
46
     * @return string
47
     */
48 1
    public function getVisibility()
49
    {
50 1
        return VisibilityEnum::VISIBILITY_PUBLIC;
51
    }
52
53
    /**
54
     * @return array
55
     */
56 1
    public function getRequestData()
57
    {
58 1
        $arr = [];
59 1
        $arr["pair"] = $this->assetPair;
60 1
        if ($this->since) {
61 1
            $arr["since"] = $this->since;
62 1
        }
63 1
        return $arr;
64
    }
65
66
    /**
67
     * @return string
68
     */
69 1
    public function getResponseClassName()
70
    {
71 1
        return SpreadDataResponse::class;
72
    }
73
}
74