Completed
Push — master ( 14b1fb...866668 )
by Fabian
03:05
created

TradableAssetPairsRequest::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 4
Ratio 100 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 2
dl 4
loc 4
ccs 3
cts 3
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace HanischIt\KrakenApi\Model\TradableAssetPairs;
4
5
use HanischIt\KrakenApi\Enum\VisibilityEnum;
6
use HanischIt\KrakenApi\Model\RequestInterface;
7
8
/**
9
 * Class TradableAssetPairsRequest
10
 * @package HanischIt\KrakenApi\Model\TradableAssetPairs
11
 */
12 View Code Duplication
class TradableAssetPairsRequest 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...
13
{
14
    /**
15
     * @var string
16
     */
17
    private $info;
18
    /**
19
     * @var array
20
     */
21
    private $pair;
22
23
    /**
24
     * TradableAssetPairsRequest constructor.
25
     * @param string $info
26
     * @param array $pair
27
     */
28 1
    public function __construct($info = 'info', array $pair = null)
29
    {
30 1
        $this->info = $info;
31 1
        $this->pair = $pair;
32 1
    }
33
34
35
    /**
36
     * Returns the api request name
37
     *
38
     * @return string
39
     */
40 1
    public function getMethod()
41
    {
42 1
        return 'AssetPairs';
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["info"] = $this->info;
60 1
        if (null !== $this->pair) {
61 1
            $arr["pair"] = $this->pair;
62 1
        }
63 1
        return $arr;
64
    }
65
66
    /**
67
     * @return string
68
     */
69 1
    public function getResponseClassName()
70
    {
71 1
        return TradableAssetPairsResponse::class;
72
    }
73
}
74