Completed
Push — master ( 3ad417...37b5d9 )
by Fabian
02:10
created

RecentTradesAbstractRequest::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 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 0
b 0
f 0
1
<?php
2
3
namespace HanischIt\KrakenApi\Model\RecentTrades;
4
5
use HanischIt\KrakenApi\Enum\VisibilityEnum;
6
use HanischIt\KrakenApi\Model\AbstractRequest;
7
8
/**
9
 * Class RecentTradesAbstractRequest
10
 *
11
 * @package HanischIt\Model\RecentTrades
12
 */
13 View Code Duplication
class RecentTradesAbstractRequest extends AbstractRequest
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 string
17
     */
18
    private $assetPair;
19
    /**
20
     * @var string
21
     */
22
    private $since;
23
24
    /**
25
     * RecentTradesAbstractRequest constructor.
26
     *
27
     * @param string $assetPair
28
     * @param string $since
29
     */
30 2
    public function __construct($assetPair, $since)
31
    {
32 2
        $this->assetPair = $assetPair;
33 2
        $this->since = $since;
34 2
    }
35
36
37
    /**
38
     * Returns the api request name
39
     *
40
     * @return string
41
     */
42 1
    public function getMethod()
43
    {
44 1
        return 'Trades';
45
    }
46
47
    /**
48
     * @return string
49
     */
50 1
    public function getVisibility()
51
    {
52 1
        return VisibilityEnum::VISIBILITY_PUBLIC;
53
    }
54
55
    /**
56
     * @return array
57
     */
58 1
    public function getRequestData()
59
    {
60 1
        $ret = [];
61 1
        $ret['pair'] = $this->assetPair;
62 1
        if ($this->since) {
63 1
            $ret['since'] = $this->since;
64 1
        }
65
66 1
        return $ret;
67
    }
68
69
    /**
70
     * @return string
71
     */
72 1
    public function getResponseClassName()
73
    {
74 1
        return RecentTradesResponse::class;
75
    }
76
}
77