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