| Total Complexity | 6 |
| Total Lines | 61 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 12 | class OpenOrdersRequest implements RequestInterface |
||
| 13 | { |
||
| 14 | /** |
||
| 15 | * @var bool |
||
| 16 | */ |
||
| 17 | private $trades; |
||
| 18 | /** |
||
| 19 | * @var string|null |
||
| 20 | */ |
||
| 21 | private $userref; |
||
| 22 | |||
| 23 | /** |
||
| 24 | * OrderBookRequest constructor. |
||
| 25 | * |
||
| 26 | * @param bool $trades |
||
| 27 | * @param null $userref |
||
|
|
|||
| 28 | */ |
||
| 29 | 3 | public function __construct($trades = false, $userref = null) |
|
| 30 | { |
||
| 31 | 3 | $this->trades = $trades; |
|
| 32 | 3 | $this->userref = $userref; |
|
| 33 | 3 | } |
|
| 34 | |||
| 35 | /** |
||
| 36 | * Returns the api request name |
||
| 37 | * |
||
| 38 | * @return string |
||
| 39 | */ |
||
| 40 | 2 | public function getMethod() |
|
| 41 | { |
||
| 42 | 2 | return 'OpenOrders'; |
|
| 43 | } |
||
| 44 | |||
| 45 | /** |
||
| 46 | * @return string |
||
| 47 | */ |
||
| 48 | 2 | public function getVisibility() |
|
| 49 | { |
||
| 50 | 2 | return VisibilityEnum::VISIBILITY_PRIVATE; |
|
| 51 | } |
||
| 52 | |||
| 53 | /** |
||
| 54 | * @return array |
||
| 55 | */ |
||
| 56 | 2 | public function getRequestData() |
|
| 57 | { |
||
| 58 | 2 | $arr = []; |
|
| 59 | 2 | $arr["trades"] = $this->trades; |
|
| 60 | 2 | if (null !== $this->userref) { |
|
| 61 | 1 | $arr["userref"] = $this->userref; |
|
| 62 | 1 | } |
|
| 63 | |||
| 64 | 2 | return $arr; |
|
| 65 | } |
||
| 66 | |||
| 67 | /** |
||
| 68 | * @return string |
||
| 69 | */ |
||
| 70 | 2 | public function getResponseClassName() |
|
| 73 | } |
||
| 74 | } |
||
| 75 |